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

Last Task responsive Website

HI, there. I´m trying to solve the last code challenge for hours now, and I don´t know, whats right. The question is:

Using the unique ID defined within the fitvid script, add the appropriate code to the div that contains the embedded video so it scales with the fluid layout.

I really don´t know, what to write.

THis is the html:

<!DOCTYPE html> <html> <head> <link href='style.css' rel='stylesheet' type='text/css'> <link href='https://fonts.googleapis.com/css?family=Nunito:400,300,700' rel='stylesheet' type='text/css'> </head> <body> <div class="container"> <div class="grid_6 omega"> <iframe src="http://player.vimeo.com/video/50610288?title=0&amp;byline=0&amp;portrait=0" width="400" height="225" frameborder="0"></iframe>
</div>

</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="jquery.fitvids.js"></script>
<script>
  $(document).ready(function(){
    $("#featured-video").fitVids();
  });

</script> </body>

</html>

This the css:

body { font-family: 'Nunito', sans-serif; font-weight: 100; color: #faf3bc; background-color: #420600; }

.grid_1 { width: 15.625%; } /* 125px/800px = 15.625% / .grid_2 { width: 32.5%; } / 260px/800px = 32.5% / .grid_3 { width: 49.375%; } / 395px/800px = 49.375% / .grid_4 { width: 65.625%; } / 525px/800px = 65.625% / .grid_5 { width: 83.125%; } / 665px/800px = 83.125% / .grid_6 { width: 100%; } / 800px/800px = 100% */

.grid_1, .grid_2, .grid_3, .grid_4, .grid_5, .grid_6 { margin-right: 1.25%; float: left; display: block; } .alpha { margin-left:0; } .omega {margin-right:0; }

.container{ width: 90%; max-width: 800px; padding: 4% 0; margin: auto; } img { max-width: 100%; } h1 { font-size: 3em; font-weight: 100; letter-spacing: -2px; }

h2 { font-weight: 100; font-size: 1.15em; color: #b4c34f; } .cupcake { box-sizing: border-box; background-color: #faf3bc; padding: 8px; margin: 0 0 5% 0; }

4 Answers

Hi there not really seeing your code but in your html do you have a div id="featured-video" anywhere?

<!DOCTYPE html>

<html> <head> <link href='style.css' rel='stylesheet' type='text/css'> <link href='https://fonts.googleapis.com/css?family=Nunito:400,300,700' rel='stylesheet' type='text/css'> </head> <body> <div class="container"> <div class="grid_6 omega"> <iframe src="http://player.vimeo.com/video/50610288?title=0&amp;byline=0&amp;portrait=0" width="400" height="225" frameborder="0"></iframe>
</div>

</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="jquery.fitvids.js"></script>
<script>
  $(document).ready(function(){
    $("#featured-video").fitVids();
  });

</script> </body>

</html>

damn, the code doesn´t paste properly here...I have two divs: one with the class "container" and one with "grid-6 omega"

Alex Heil
Alex Heil
53,547 Points

hey pia, the fitvids script you inserted has a special id "featured-video". now to make your video responsive using fitvids you need to add this id to that div (doing so the script knows that it should do it's work there). so in your html markup search for the div block that contains the video and add the id="featured video" to that div. that should already do the trick - hope that helps ;)