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 trialS. K.
Courses Plus Student 2,497 PointsStuck on "Content Defined Breakpoints" Challenge
I have the following challenge:
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.
and have added these conditions at the end:
@media screen and (max-device-width: 705px) {
.grid_1,
.grid_2,
.grid_3,
.grid_4,
.grid_5,
.grid_6 {
width: 100%;
}
}
What am I doing wrong..?
5 Answers
Edward Boyce
Front End Web Development Techdegree Student 3,799 PointsTry with just max-width not max-device-width. You have to get it exactly how they teach you.
S. K.
Courses Plus Student 2,497 PointsThanks Edward. That worked. However, I'm having a challenge with the 2nd task now, which is frustrating since I was doing pretty well with the challenges so far:
Add the appropriate CSS within the same media query that will force the βlove at first biteβ illustration to disappear.
CSS I added:
@media screen and (max-width: 705px) {
.grid_1,
.grid_2,
.grid_3,
.grid_4,
.grid_5,
.grid_6 {
width: 100%;}
.grid_2 omega {display:none;}
}
HTML Markup:
<div class="grid_2 omega">
<img src="img/love-at-first-bite.gif" alt="Love at First Bite">
</div>
I wonder whether I should add an ID to the HTML, but I guess that's not the solution. Also, I tried adding image after the class identifier.
Edward Boyce
Front End Web Development Techdegree Student 3,799 PointsI believe it's within the #intro div if I recall. So you would use;
#intro img {
display: none;
}
I may be wrong but this is from memory.
EDIT: UPDATED
Removing the element .grid_2 with display:none; would cause problems with other classes using this grid markup, the grid layout elements are intended to be re-used multiple times on pages so you would want to avoid using display: none; on those elements.
For instance if you had another image in a grid_2 class div somewhere else on the page but wanted it displayed, your code would hide all markup for those elements that use the class grid_2.
S. K.
Courses Plus Student 2,497 PointsThanks again Edward, but this was solved by ommitting the "omega" at the end of the identifier.
What is the best way to comprehend the information overload? code as I watch or watch focused, and then code and refer to videos if I get stuck? just finished "Responsive Websites" and trying to responsify the Smells Like Bakin' website...a bit lost to be honest!
Edward Boyce
Front End Web Development Techdegree Student 3,799 PointsAbsolutely take your time with the videos, they are great and a good reference. Pause the video and code then press play again, go at a steady pace and just keep comparing your code with the teachers if you feel lost.