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
Shaun Taylor
2,654 PointsI would like to apply max-width: 100%; on all images EXCEPT logo!
Hello,
I'm currently doing the 'build a responsive website' project. Im on the 'scalable images' part of the 'creating a fluid fountain' module.
As instructed, I have used the following simple piece of CSS in the global part of my style sheet:
img { max-width: 100%; }
This works fantastically for all of the images on my site. However, it also has an effect on the logo which I don't want.
As this is applied to the logo, when the browser shrinks down to mobile page size, the logo becomes almost too small to see.
So, I would like this piece off CSS to apply to all images on my website, apart from the logo.
Any hep would be greatly appreciated :)
Thanks,
Shaun,
2 Answers
Adam Sackfield
Courses Plus Student 19,663 PointsYou could add an ID to your logo and then add this in css
#logo { // Style Here }
Then set the new width you want and just ensure this comes after the first img rule.
Shaun Taylor
2,654 PointsWorked perfectly! Thank you so much :) I used:
logo {
width: 249px;
}
After applying the ID to a div surrounding my logo.
Thanks again - really appreciate the help.
Adam Sackfield
Courses Plus Student 19,663 PointsNo worries anytime