Fluid Width Video For YouTube

by | Nov 14, 2016 | Web Development | 0 comments

My problem… getting an embedded YouTube video to automatically resize according to container sizes.

This is how you would post the embeded video:

<div class="videoWrapper">
    <!-- Copy & Pasted from YouTube -->
    <iframe width="560" height="349" src="http://www.youtube.com/embed/n_dZNLr2cME?rel=0&hd=1" frameborder="0" allowfullscreen></iframe>
</div>

Then add the following custom CSS:

.videoWrapper {
	position: relative;
	padding-bottom: 56.25%; /* 16:9 */
	padding-top: 25px;
	height: 0;
}
.videoWrapper iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

Source with more info on other video sources: https://css-tricks.com/NetMag/FluidWidthVideo/Article-FluidWidthVideo.php

Formula 1: Drive to Survive | Official Trailer

“Meet the families, the teams and the drivers behind the visors in this documentary Formula 1: Drive to Survive.” – Netflix

Seagate, Oh Why Do You Fail Me?

Out of the 13 plus years I’ve been repairing computers (hobby turned nightmare)… if I were to keep a log of hard drive failures, Seagate internal hard drives have let me down more times than any other brand.

The EM Drive: Fact or Fantasy?

Opening up new horizons in space travel!

A Study Claims Marmite Can Help Against Dimentia

Study claims Marmite helped protect against Alzheimer’s and Parkinson’s.

Can You Get A Stylist For A Kindle?

Emailed from a friend of mine. While reading questions directed towards users of the Kindle Paperwhite I came upon this question and answer which rose to the top of the list with nearly 1650 votes.. nearly 1600 over any other reviewers response.. Question Can you get...

Meet the Rezvani TANK

“An Extreme Utility Vehicle built for any off-road and on-road challenge.” – Rezvani

Fluid Width Video For YouTube

My problem... getting an embedded YouTube video to automatically resize according to container sizes. This is how you would post the embeded video: <div class="videoWrapper"> <!-- Copy & Pasted from YouTube --> <iframe width="560" height="349"...

Less Is Now | Official Trailer

I am so excited about this. I am a huge fan of their documentary years ago and look forward to this new installment, adding much needed renewed energy toward the minimalism movement. Longtime friends Joshua Fields Millburn and Ryan Nicodemus share how our lives can be...

Garbage – No Gods No Masters (Official Music Video)

Garbage nails it again - always! The instrumentals on this particular track remind me of the 90s with a dash of 80s vibe thrown in, and I love it. Shirley delivers in all of her lyrical glory. Here’s the official video of the title track from Garbage’s forthcoming...

Hyper-Reality

Keiichi Matsuda brings us “Hyper-Reality”, a provocative and kaleidoscopic new vision of the future.