I have a div directly under the body. My HTML looks like this:
And the css I use is this:
border:1px solid black;
This div doesnt stretch to the entire viewport/available body height. However, if I change the position to absolute, It does stretch.
Is there a way to get a relative positioned element to stretch to its container element height. I tried height 100% as well and it works but it gives a vertical scrollbar to me as the element is positioned at 100px from TOP.
以上就是Expand a relative positioned element to full container height的详细内容，更多请关注web前端其它相关文章！