CSS aspect-ratio & Aspect Ratio Hack Generator

Generate modern CSS aspect-ratio properties and legacy padding-bottom percentage hacks.

Aspect Ratio

:
Simplified: 16:9 = 1.7778 (56.25% padding-top)

Container Settings

Width %100%

Preview (800×450px)

16:9

Modern (aspect-ratio property)

Chrome 88+, Firefox 89+, Safari 15+

div {
  aspect-ratio: 16 / 9;
  width: 100%;
  max-width: 1200px;
  height: auto; /* let aspect-ratio handle this */
}

Legacy (padding-top hack)

Works in all browsers incl. IE11

.ratio-box {
  position: relative;
  width: 100%;
  padding-top: 56.2500%; /* 16:9 */
}
.ratio-box > * {
  position: absolute;
  inset: 0;
}

Fixed height (px)

Height = 450px at current container

div {
  width: 100%;
  height: 450px; /* 16:9 at 800px wide */
}
Runs in your browser. Your file and input data are never uploaded to any external server.
Mode: Local BrowserMax Limit: 50 MB

Frequently Asked Questions — CSS aspect-ratio & Aspect Ratio Hack Generator

What does CSS aspect-ratio & Aspect Ratio Hack Generator do?

Generate modern CSS aspect-ratio properties and legacy padding-bottom percentage hacks. It is part of the VEXOR Design suite designed for fast, distraction-free workflow. Supports files up to 50 MB per operation.

Is my data private when using CSS aspect-ratio & Aspect Ratio Hack Generator?

Yes. CSS aspect-ratio & Aspect Ratio Hack Generator runs 100% locally inside your web browser using client-side APIs. Your files and input data never leave your device and are never uploaded to any external server.

Is CSS aspect-ratio & Aspect Ratio Hack Generator free to use without registration?

Yes. CSS aspect-ratio & Aspect Ratio Hack Generator on VEXOR is completely free to use with no account sign-up, no watermarks, and no forced ads before downloading or copying your result.

View all Design tools