{
  "id": "aspect-ratio-box",
  "name": "Aspect Ratio Box",
  "category": "layouts",
  "tags": [
    "aspect-ratio",
    "video",
    "responsive",
    "embed",
    "media"
  ],
  "description": "Locks any element to a 16:9 ratio, perfect for video embeds and image placeholders.",
  "url": "https://copy-css.com/snippets/aspect-ratio-box",
  "markdown": "https://copy-css.com/snippets/aspect-ratio-box.md",
  "html": "<div class=\"ratio-box\">16 : 9</div>",
  "css": ".ratio-box {\n  aspect-ratio: 16 / 9;\n  width: 100%;\n}\n\n/* Make embedded media fill the box */\n.ratio-box > iframe,\n.ratio-box > img,\n.ratio-box > video {\n  width: 100%;\n  height: 100%;\n  border: 0;\n  object-fit: cover;\n}",
  "features": [
    "aspect-ratio"
  ],
  "customProperties": []
}
