I'm developing this website and I want the right sidebar to have 100% height.
body { height: 100%; min-height: 100%; position: relative; } mydiv { height: 100%; min-height: 100%; position: absolute; top: 0; right: 0; bottom: 0; width: 290px; }
I've read a lot of answer, especially this (Prestaul answer): Setting 100% height on an absolutely positioned element when the content expands past the window size.
But for me this trick does not work, also the fiddle exemple doesn't work!
This is the jsfiddle working example.
This is the same code that doesn't work.
With no height value provided for the HTML element, setting the height and/or min-height of the body element to 100% results in no height (before you add content).
That is because you have align-items: center for the flexbox in which case it will default to the content height. What you need to do is to remove that (let align-items: stretch come into play as it is the default) and also remove the height:100% from CASideBorder .
Set the html tag, too. This way no weird position hacks are required.
html, body {height: 100%}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With