Search documentation

Find a component or a docs page

Aspect Ratio

Displays content within a desired ratio.

Usage

16/9

ratio: takes a "W/H" String or a Numeric (16.0 / 9). The image is positioned by its own classes; AspectRatio only sizes the box.

4/3

1/1

21/9

Content taller than the ratio

The box grows when its content is taller than the ratio allows. With overflow-hidden it keeps its 4/1 ratio and clips the lines that don't fit. Remove overflow-hidden and the box grows to show all eight.

Installation

Components

ComponentBuilt usingSource
AspectRatioPhlex
AspectRatioDocsPhlex