I'm currently trying to build a responsive website layout with flexbox.
Depending on the screen size I want an element to have position: fixed;
This itself is working. But when I use justify-content: space-between;
on a column that contains an element that gets moved out of the of column itself with position: fixed;
the space distribution uses this element as an 0 height element.
For the sake of demonstration I set up two examples. Both do not use media queries because they are not the problem.
In the first example I created what I want the final result to look like. I had to move #fixed
outside of .column
in order for the space distribution to work properly.
In the second example I created the desired HTML markup. When you compare both example side by side you will notice that the spacing looks odd in the second. The browser is not making an error here because there is an element it has to respect when distributing the space. I (in a nutshell) would like the browser to pretend #fixed
is not inside the container and therefore not consider it when distributing space.
This is how the result should look: https://jsfiddle.net/5nu9nsyL/3/
And this is how the html should look: https://jsfiddle.net/5nu9nsyL/4/
(Only Chrome and Safari renders it correctly. So if both look the same to you have a look at it with a different browser like Firefox or IE)
I hope I made my it clear what I want.
(Note I must use display: flex
on the container .column
)
(I also need a JavaScript free, CSS only solution)