Skip to content

Aspect Ratio

Objects
The aspect-ratio CSS property allows you to define the desired width-to-height ratio of an element's box. When setting an aspect ratio on an element regardless of the parent container or viewport size, the browser will adjust the element's dimensions to keep the specified width-to-height ratio. The aspect ratio will only work on objects like images and iframes but will not work with divs.
Class Properties
wpex-aspect-1-1
aspect-ratio: 1 / 1
wpex-aspect-4-3
aspect-ratio: 4 / 3
wpex-aspect-16-9
aspect-ratio: 16 / 9