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

Help needed with implementing media queries

Add the appropriate CSS code to the media query so that ".contact" and ".menu" fill the entire container width when the device or browser width is at most 480px wide.

http://teamtreehouse.com/library/websites/build-a-responsive-website/adaptive-design/implementing-media-queries-2

The second challenge task. What is the CSS code to be written between the {} at the bottom of the style sheet. I have been asking this for a month but no clear answer.

Please help

.menu { width:100%; }

        .contact {
    width:100%; 
  }

3 Answers

.contact,
.menu{
    width: 100%;
}

Thanks Chase James, This worked. How about the third task?

Add the appropriate CSS code to the media query so that images within the ".cupcake" div disappear when the device or browser width is at most 480px wide.

.cupcake{
    display: none;
}

Once again I have written the exact way you have shown me but it hasn't worked this time. Here is what it looks like but it says the cupcake is still visible even when the width is less than 480px.

     /* Mobile ----------- */
     @media screen and (max-width : 480px) {
      .contact,.menu {width:100%;}
      .cupcake {display: none;}
     }

Oops. It's:

.cupcake img{
    display: none;
}

What .cupcake was doing, was selecting the entire div what .cupcake img is doing is selecting all of the images inside of that div.

Just tag me if you need me again.

Write a media query at 705px where the layout begins to break, that forces grid_1 through grid_6 to span 100% width of the container.

teamtreehouse.com/library/content-defined-breakpoints.

I have encountered a bummer in the 1st task. pls help