I am working on a page layout with a horizontal scrollbar.
I have some panels with fixed widths in a horizontal order, which should all have the viewport height. I decided to test the vh
unit to do that.
.panel { height: 100vh; }
This is working fine, until I get a scrollbar.
The problem is, that vh
ignores the height used by the scrollbar and therefore adds a vertical scrollbar.
I would like to subtract the height of the scrollbar from the measurements of vh
; is there any way to do this?
.panel { height: calc(100vh-17px); }
. I don't know how big the scroll bar is and if this is browser/OS dependent.Unexpected CSS token: )
. And still, there would be the problem with the unknown scrollbar height, as you mentioned before.html, body, .content { height: 100%; }
seems to work for now, but any good solution for usingvh
would be appreciated.overflow-x: scroll;
on the root element, this will deduct the scrollbar height from the viewport height. It'd also work horizontally but the massive problem with this is that it's currently only supported in Firefox.