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 trialmitchell green
3,339 PointsAdd the appropriate CSS code to the CSS to make images scale with the fluid layout.
Add the appropriate CSS code to the CSS to make images scale with the fluid layout.
im confused on what code to write. will someone help???
4 Answers
Jason Anello
Courses Plus Student 94,610 PointsFor an explanation:
Did you try going into preview mode and shrinking your browser width to see what happens to the image?
You'll see that the cupcake menu column shrinks in width but the image stays the same size and eventually the custom orders column will overlap the image.
They want the image to be able to shrink or expand along with the cupcake menu column that it is in.
By making the width 100% it will take up the width of its parent. It's basically saying, take up all the space that is available.
. Ali
9,799 Points img {
max-width : 100%;
height : auto;
Jason Anello
Courses Plus Student 94,610 PointsThis will work too.
img {
width: 100%;
}
Jason Anello
Courses Plus Student 94,610 PointsThis will work too.
img {
width: 100%;
}
Jason Anello
Courses Plus Student 94,610 PointsSorry for the double post. Editing a comment seems to be a little messed up.
mitchell green
3,339 Pointsthanks jason
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.
can you help me with this too.
mitchell green
3,339 Pointshow did you get this?
mitchell green
3,339 Pointsokay thanks
mitchell green
3,339 Pointsokay i think i understand now. Thanks!
mitchell green
3,339 Pointsmitchell green
3,339 PointsOkay i think i understand it now. Thanks!
mitchell green
3,339 Pointsmitchell green
3,339 Pointsokay so what about this:
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.
I typed the code: .contact { max-width: 100%; } .menu { max-width: 100%; }
and i get the error of: Did you add your code inside the media query?
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsYou're close and the only mistake you might have made is where you placed it.
If you look towards the end of the styles you'll see that they have already setup the media query for you.
Did you place your styles inside that media query?
Also, you can use width instead of max-width.
mitchell green
3,339 Pointsmitchell green
3,339 Pointsi figured it out but thanks for your help any ways:)
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsYou're welcome