How to do a Responsive YouTube video embed?
Looking for this instead? How to Embed a YouTube Short
Copy the paste below and replace the embed string for a full width display.
<div class="ratio ratio-16x9">
<iframe src="https://www.youtube.com/embed/h-FMndW2kHo" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
Results:
Copy the paste below and replace the embed string for a fixed width display.
Example below uses 400px fixed width.
<div style="max-width: 400px; margin-left: auto; margin-right: auto;">
<div class="ratio ratio-16x9">
<iframe src="https://www.youtube.com/embed/h-FMndW2kHo" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</div>
Results:
Building Relationships with Web Developers and Marketing Agencies that want better results
The world's fastest and most SEO friendly website code.