I'm trying to use a simple flex layout that consists of a header, a 2x2 content grid, and then a sidebar. When the width of the window is smaller than a certain size, the sidebar should move to the bottom of the screen.
Currently, once that size is reached, if the height of the window is made too small, the grid content will overlap above the header, but I don't know why this is the case. The screen should only be the size of the view's height, but moving the sidebar causes it to expand.
@media (max-width:960px) { .main-screen { height: 100vh; display: flex; flex-direction: column-reverse; .toolbar { padding: 10px; height: 90px; width: auto; } .body { display: flex; .grid { flex: 1; max-height: 36vh; } .row1, .row2 { flex: 1; height: 10%; max-width: 100%; } } } }
This is the complete code in jsfiddle
(Just resize the window to see how the grid overlaps above the title)
Hello ^^ I built this for you. Is this what you want?