--- title: Responsive Embed description: Wrap embedded content like videos, maps, and calendars in a responsive embed container to maintain the correct aspect ratio regardless of screen size. sass: scss/components/_responsive-embed.scss tags: flex video 'flex video' video: GxUsloI_qnQ --- To make sure embedded content maintains its aspect ratio as the width of the screen changes, wrap the `iframe`, `object`, `embed`, or `video` in a container with the `.responsive-embed` class.
```html_example ``` --- ## Aspect Ratios Add ratio classes to change the aspect ratio of responsive embeds. The default ratio is 4:3. The `.widescreen` class will change the container's aspect ratio to 16:9. ```html_example ``` The ratio classes are generated by the keys in the `$responsive-embed-ratios` map in your settings file. Only the `default` key is required. You can, for example, make your default ratio 16:9, remove widescreen, and add other aspect ratios. ```scss $responsive-embed-ratios: ( default: 16 by 9, vertical: 9 by 16, panorama: 256 by 81, square: 1 by 1, ); ``` ```html_example ```