element { aspect-ratio: 16 / 9; } and the element’s default width: auto kicks in implicitly to set the element’s dimensions. View live demo on CodePen It changes when width or height are on the same element. Let’s say we have an element with a width of 300px and an aspect-ratio of 3/1..element { aspect-ratio: 3 / 1; width: 300px; }
Theaspect ratio is the proportional relationship between a TV or projector screen’s width and height. Common ratios are 4:3, 16:9, and 21:9. 4:3 is a more square format that was used on early TVs. 16:9 is now the standard widescreen format. 21:9 is an ultrawide format gaining popularity in high-end displays. It provides an immersive 219 aspect ratio: 2560××1440, 3840×1600, 5120×2160; 16:9 aspect ratio: 1280×720, 1366×768, 1600×900, 1920×1080, 2560×1440, 3840×2160, 5120×2880, 7680×4320; 16:10 aspect ratio: Theaspect ratio indicates the ratio between the width and length of a screen. In total, there are 4 different aspect ratios. 4:3 monitors have a rectangular shape and aren't very common. This ratio is mainly used in the United States. 16:9 monitors are the standard in Europe. These monitors are most common and are suitable for every situation. . 111 324 159 143 20 285 336 160 113