master-wiki/03. Resources/Development/Iframes.md
2024-03-12 13:50:19 -03:00

24 lines
450 B
Markdown

---
created: 2024-02-20 11:43
updated: 2024-03-12 13:49
---
## How to make an Iframe 100% it's parent width while maintaining the aspect ratio
In this example, we need to wrap the iframe in a container class and provide the following styles:
```css
.container {
position: relative;
width: 100%;
height: 0;
padding-bottom: 56.25%;
}
iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
```