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

David Zupec
David Zupec
2,276 Points

Build a responsive website code challenge

Has anybody else completed this challenge successfully? I did it correctly but it keeps saying I didn't! The code challenge I'm referring to is the one below.

Code Challenge: Flexible Videos with FitVid.js

8 Answers

John Locke
John Locke
15,479 Points

All you have to do is add id="featured-video" to the parent div of the iframe.

Kya Sinclair
PLUS
Kya Sinclair
Courses Plus Student 2,044 Points

Okay John, that's great, but it would be nice to include "extra divs are not always necessary" in the tutorial, or at least in the hints.

For anyone still stumped after trying and trying (and if you are reading this, you tried and tried): the finished code should look like this: div class="grid_6 omega" id="featured-video"

James Barnett
James Barnett
39,199 Points

Kya Sinclair - If I had to guess on why you found this code challenge so hard it would be that it's an intermediate course and didn't finish the pre-requisite CSS Foundations course first.

Of course, I don't work for Treehouse and don't have anything to do with the making of the courses, that's just my 2 cents judging by the questions I've seen on the forum and which badges those users have normally completed.

James Barnett
James Barnett
39,199 Points

Kya Sinclair - Generally we try not to give away answers here on the forum, instead try to help users understand why there code doesn't work and point them in the right direction of how to fix it. A user doesn't learn a whole lot from cutting and pasting your correct answer.

My suggestion here would be instead of saying the finished code should look like this and not explaining why that version works when so many other versions didn't work. Instead you could link to a resource on how to use multiple classes and IDs in your HTML & CSS.

Kya Sinclair
Kya Sinclair
Courses Plus Student 2,044 Points

Thanks James for your emails. I don't know why I am receiving your emails in duplicate, but my inbox has time stamps five minutes apart for each one. Could you see why that's happening on your end?

I really do appreciate the hints and suggestions on the forum. I've been teaching for many years and my students always appreciate a little in depth help especially when they get stumped. It clears the confusion and helps them to move on. I did do the CSS Foundations course quite some time ago and John's hint was not in there. I believe John's hint would be a wonderful addition to the tutorial. I hope my input helps anyone who is stuck and needs help. If it doesn't, then maybe my entire posts should be removed as not to hinder anyone.

It's pretty simple, James Barnett: that's not what Allison did in the video. She created a new div, which is what most of us did as well. At the very least, that alternative solution (although not optimal) should be allowed as a possible answer, or having the video suggest placing it in the container div.

John Locke
John Locke
15,479 Points

@David Post your code, and I'll try and replicate what is happening on your end.

David Zupec
David Zupec
2,276 Points

Hello John. it's asking to put the appropriate div code around the video. Here's what I did:

  <div id="featured-video">
<iframe src="http://player.vimeo.com/video/50610288 title=0&amp;byline=0&amp;portrait=0" width="400" height="225" frameborder="0"></iframe>     
  </div>
John Locke
John Locke
15,479 Points

Hi David:

OK, I figured it out. Here's a solid hint:

Your divs can have both class AND id attributes.

Let me know if you're still stuck after that.

David Zupec
David Zupec
2,276 Points

Hey John, I'm still not getting it lol! Based on this script below I should just need to wrap the video with a div id of featured-video.

<script>
  $(document).ready(function(){
    $("#featured-video").fitVids();
  });

</script>

David Zupec
David Zupec
2,276 Points

Lol wow thanks John that worked! I didn't think to just add it to the class : )

John Locke
John Locke
15,479 Points

Yup, extra divs are not always necessary. Happy Building!