Aspect ratio

noun

say it: “AS-pekt RAY-shee-oh” /ˈæspɛkt ˈreɪʃioʊ/

The shape of a box as width compared with height, such as 16 / 9; in CSS, the aspect-ratio property keeps a box that shape at any width.

What does aspect-ratio do?

aspect-ratio keeps an element's width and height in proportion, like 16:9 for videos.

.video-thumb { width: 100%; aspect-ratio: 16 / 9; }

In a sentence

  • “I gave every thumbnail an aspect ratio of 16 / 9, so the playlist grid stays tidy at any width.”

Level: Freelancer · More CSS terms at this level

Updated