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
Arnold Omwango
Courses Plus Student 1,969 PointsHelp 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.
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
3 Answers
Chase Lee
29,275 Points.contact,
.menu{
width: 100%;
}
Arnold Omwango
Courses Plus Student 1,969 PointsThanks 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.
Chase Lee
29,275 Points.cupcake{
display: none;
}
Arnold Omwango
Courses Plus Student 1,969 PointsOnce 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;}
}
Chase Lee
29,275 PointsOops. 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.
Chase Lee
29,275 PointsJust tag me if you need me again.
Arnold Omwango
Courses Plus Student 1,969 PointsWrite 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
Donna Felipe
3,972 PointsDonna Felipe
3,972 Points.menu { width:100%; }