Great content. 1. It’s like giving a font size of 5% of the viewport width. Let’s define what we mean when we talk about media queries based on “width” and “device-width”. Last Updated: 30-06-2020 In the HTML webpage, when applying values to the CSS properties, the … Making a background image fully stretch out to cover the entire browser viewport is a common task in web design. Largeur adaptable sans requête media. Here it is set to a special value(“width= device-width”) which is the width of the device in terms of CSS pixels at a scale of 100%. Mobile phones and other devices with smaller screens display pages in a virtual window or viewport.. - content="width=device-width" - initial-scale=1.0 (La propriété initial-scale spécifie l'échelle de la fenêtre (zoom). .edu { Similarly, if the viewport width is smaller than the height, the value of 1vmin will be equal to 1% of the viewport width. fiddle: resizeByWidth. width: 320; When designing websites, the viewport is an HTML meta tag (or @ rule in CSS) that is used to set styles and other website attributes to render the site on different devices. vmin - A percentage of the minimum of the two. In our example 50vmin = 400px since we are in landscape mode. The number of pixels when you set something to width: 160px in CSS relates to CSS pixels, which have very little to do with the actual pixels of the device.. Chris takes this one step farther in his pre-viewport-units article, so we will too. Change your body height: 100vh to min-height: 100vh and the footer will stay in place at the bottom of your screen until it’s pushed down by content. To calculate the viewport width of your device, you can run window.innerWidth on browser dev tool console. } (Side note: there are two types of d… Here Let’s see some examples with the viewport in action.