Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Responsive Web Design

You're reading from   Mastering Responsive Web Design Push your HTML and CSS skills to the limit and build professional grade, responsive websites

Arrow left icon
Product type Paperback
Published in Aug 2015
Publisher
ISBN-13 9781783550234
Length 334 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Ricardo Zea Ricardo Zea
Author Profile Icon Ricardo Zea
Ricardo Zea
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Harness the Power of Sass for Responsive Web Design FREE CHAPTER 2. Marking Our Content with HTML5 3. Mobile-first or Desktop-first? 4. CSS Grids, CSS Frameworks, UI Kits, and Flexbox for RWD 5. Designing Small UIs Driven by Large Finger 6. Working with Images and Videos in Responsive Web Design 7. Meaningful Typography for Responsive Web Design 8. Responsive E-mails Index

Making videos responsive

The videos we're going to talk about are the videos that come inside our good old friend, the <iframe> element, such as videos from YouTube, Vimeo, Dailymotion, and so on. There are several ways to make videos responsive, some more involving than others. Let's break it down.

Responsive videos with HTML and CSS

YouTube is an amazing video service that makes life easier for everyone—video authors, as well as web designers and developers. The fact that YouTube takes care of the hosting of the video, the streaming, and the technological conditions of browsers that don't support Flash (iOS), or browsers that don't support the <video> tag (legacy browsers), is just awesome.

The first thing we need to do is create a container that will hold the video. This container is the one we're going to manipulate to give the video the width we want while maintaining its aspect ratio:

<div class="video-container"></div&gt...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime