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
Larry Mc Goldrick
4,131 PointsImplementing Media Queries
Hi, Having some problems with the code challenge on this, cannot seem to scale images with the fluid layout, even just a push in the right direction would be nice thanks.
Larry
8 Answers
Guil Hernandez
Treehouse TeacherHi Larry,
Can you please post your code here, so we can see what's going on?
Thanks!
Larry Mc Goldrick
4,131 PointsHi Guil, I tried a few different ways here is one of them, its probably pretty clear that I have missed this section somewhere but I cant seem to find it:
/* Mobile ----------- */
@media screen and (max-width : 480px) {
img {
width: 192px:
height:80px
}
}
I tried to reduce the image by 1/2 but this doesn't seem to work. Thanks, Larry
Ian Lunn
4,558 PointsYou have an error in your code. After the width declaration, you should have a semi-colon (;) rather than colon (:).
width: 192px;
Larry Mc Goldrick
4,131 PointsGrrrrrrrrr, Thanks Ian, still not passing but at least its going in the right direction.
Larry
Ian Lunn
4,558 PointsI haven't done/can't remember doing the challenge so if you could paste in exactly what it wants you to do, that would help.
From what you've said though, if you want the image to scale, rather than:
width: 192px;
height: 80px;
Try:
width: 100%;
height: auto;
Larry Mc Goldrick
4,131 PointsThe Task is: Add the appropriate CSS code to the CSS to make images scale with the fluid layout.
Guil Hernandez
Treehouse TeacherHi Larry,
To make the images scale with the fluid layout, you'll need to define a width that is 100% the width of its container.
You also do not need to define this within a media query.
Larry Mc Goldrick
4,131 PointsThanks Guil + Ian, Section finished now =)
Larry