Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS How to do this app-layout without media queries?

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #256849
    Oskar
    Participant

    Hi, I’m trying to do a (apparently not so) simple app layout. It consists of one container with two cells.

    Below 25em the two cells should be in one column. Above 25em they should be side by side. Both cells should fill the size of the container. The last cell should show scrollbars, if necessary.

    Since the layout is for a responsive web component I can not use media queries. Here’s what I have so far. The missing piece is enabling overflow when the cells are in one column (below 25em).

    https://codepen.io/anon/pen/YQbzer

    Been struggling with this… Any help would be greatly appreciated!

    #256852
    Beverleyh
    Participant

    Put max-height:50vh; on .overflow?

    Also, why not use flex-basis:25em; flex-grow:1; on .container > * instead of what you have there already? i.e. The “Fab Four” calc method, which seems to make more sense in circumstances where no flexbox at all can be used. Why mix them? If you’re using flexbox, why not use it all the way?

    #256853
    Beverleyh
    Participant
    #256854
    Oskar
    Participant

    I should of course have mentioned that users will be able to resize the width and height of .container. So unfortunately I can’t set a fixed height on any children.

    Flex-basis+grow works nicely for the layout. Thank you. Just need it to overflow below 25em now..

    Updated version: https://codepen.io/anon/pen/eRaRYo

    #256855
    Beverleyh
    Participant
    #256856
    Oskar
    Participant

    Thank you! Works great.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘CSS’ is closed to new topics and replies.