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

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. HELP!!!!!!

The code attached below is in one of the quizzes, I am completely stumped!! Please help.

<!DOCTYPE html> <html> <head> <link href="//fonts.googleapis.com/css?family=Nunito:400,300,700" rel="stylesheet" type="text/css"> <style> body { background-color: #420600; color: #FAF3BC; font-family: 'Nunito', sans-serif; font-size: 1em; font-weight: 100; } img { margin: 2% 0; max-width: 100%; } h1 { font-weight: 100; font-size: 2.25em; margin: 5% 0; } h2 { font-weight: 100; font-size: 1.500em; color: #B4C34F; } h3 { font-weight: 100; font-size: 1.25em; color: #4FB69F; } h2, h3 { margin: 0; padding: 0; } p { margin: 5% 0; } strong { font-weight: 300; color: #B22316; } div { box-sizing:border-box; -moz-box-sizing:border-box; /* Firefox / -webkit-box-sizing:border-box; / Safari */ } #container { max-width: 1000px; width: 100%; margin: 0 auto; } .menu { width: 60%; margin: 0 0 2% 0; float: left; }

ul.prices {
  font-size: .75em;
  list-style: none;
  padding: 2% 0;
  margin: 0;
}
.prices li {
  float: left;
  width: 33.3333333%;
}

.cupcake {
  border-bottom: 1px dotted #FAF3BC;
  padding: 5% 0;
}
.cupcake p {
  margin: 0;
}
.cupcake:nth-child(2) {
  border-top: 1px dotted #FAF3BC;
}
.contact {
  width: 35%%;
  margin: 5% 0;
  padding: 3%;
  float: right;
  background-color: #2e0400;
  border-radius: 15px;

}
.contact span {
  color: #B22316;
  font-weight: 600;
}

/* Mobile ----------- */
@media screen and (max-width : 480px) {
}

4 Answers

Allison Grayce Marshall
STAFF
Allison Grayce Marshall
Treehouse Guest Teacher

Hey Brandon! You're on the right track.

Within the media query, force .contact and .menu to fill 100% of the container for resolutions smaller than 480px:

@media screen and (max-width : 480px) {
    .contact, .menu { width: 100%; }
}

Check out the CSS selectors badge if you still need some help! http://teamtreehouse.com/library/websites/css-foundations/selectors

Thanks for the help Allison!!

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

}

This what mine looks like, but am still getting the error "Bummer! Don't change the widths outside of the media query!"

Am not sure why some of the text is not showing but i pretty much copied your instructions from above but still getting the error message.