Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Resizing Iframes using CSS?

My iframe is width="1280" height="720" on my page.

My mediaquery is not resizing it.

@media screen and (max-width:600px){

iframe { width= 560px ; height= 315px ;

}

}

3 Answers

Keep in mind that an iFrame has its own viewport. Also you are writing CSS so it should be

iframe{
 width: 560px;
 height: 315px;
}

I'm trying to make the video responsive.

http://pikamoo.github.io/

wrong answer, sorry

Use Fitvids.js It does some crazy stuff with intrinsic ratios and wahh laaa fluid videos

Very Neat! I will use this on another project for sure. This project I'm only using html and css.