I'm looking to "freeze" (i.e. hold in place regardless of vertical scrolling) two columns and a header in my page's layout. I've done this sort of thing in the past on a div using:
position: fixed;
But this destroys my layout consistency when using CSS3 Flexboxes.
Does anyone know how/if this can be accomplished without using JavaScript?
For reference, here's my layout:
There are two flex containers below the header. The outer flex container controls "Col 1" and "Col 2", and the inner container controls "Col A", "Col B", and "Col C" and it's placed on "Col 2" itself (so "Col 2" is a flex container and flex item). "Col 2" has no content itself and its sole purpose is to act as a container.
I'd like to freeze "Col 1", "Col C", and ideally the header as well:
The outer flex container flex CSS is:
display: flex;
flex-direction: row;
flex-wrap: nowrap;
"Col 1" is:
flex: 1 6 25%;
"Col 2":
display: flex;
flex-direction: row;
flex-wrap: wrap;
flex: 3 1 75%;
order: 2;
"Col A":
flex: 2.5;
"Col B":
flex: 2.5;
"Col C":
flex: 1;
Header:
display: flex;
flex-direction: row;
flex-wrap: wrap;
Edit: Here's a Plunker demonstrating the layout I have: https://plnkr.co/edit/5yJjIYiupJoNItikFg5P?p=preview