Top "Viewport-units" questions

The viewport units `vh`, `vw`, `vmin` and `vmax` are units of measurement relative to the browser viewport size, introduced in CSS3.

Safari + CSS: using "calc" with "vh" does not work

I'm encountering a very niche issue CSS issue on Safari. I have the following CSS rule: min-height: calc(100vh - 115.5…

css safari viewport-units
Safari CSS rule vh-units?

Does anybody know if there is a fix for Safari vh rule? #what{ min-height:70vh; } All working ok, in all …

html css safari viewport-units
How to write css fallbacks for vh vw

Can anyone explain how fallbacks work in CSS? I am trying to set it up for vh and vw and …

css fallback viewport-units
Vertically centering inside a div with vh

I'm currently trying to center an image inside a div that has it's dimensions set with vh. I tried using …

html css vertical-alignment centering viewport-units
"vw" CSS units in calc in Chrome not working

The new vw (and vh, vmin and vmax) CSS units are quite useful, as is calc. Both work fine in …

css google-chrome viewport-units
How do I get document height using vh units in jQuery?

$(window).scroll(function() { $scrollingDiv.css("display", (($(window).scrollTop() / $(document).height()) > 0.1) ? "block" : ""); }); How can I change the unit $(document).height()) &…

javascript jquery viewport-units
Convert vh units to px in JS

Unfortunately 100vh is not always the same as 100% browser height as can be shown in the following example. The issue …

javascript css viewport-units
How to prevent vh-units from ignoring the scrollbar?

I am working on a page layout with a horizontal scrollbar. I have some panels with fixed widths in a …

css units-of-measurement viewport-units
Relative padding and vh units - bug or spec misunderstanding?

DEMO Sometimes I'll create a square (or any rectangle, really) that will respect its ratio at any size using a …

css viewport-units
VW and VH units are not accurate

width: 100vw;/* 100% of viewport width */ height: 100vh;/* 100% of viewport height*/ This CSS should give me the exact(100%) dimensions of the …

html css viewport-units