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

CSS How to Make a Website Styling Web Pages and Navigation Make a CSS Image Gallery

Mohsen Qaddoura
Mohsen Qaddoura
22,237 Points

No HTML code shown to assist in addressing the proper selector for images!

There is no html code to refer to so as to address the images with the proper selector. Am I supposed to memorize that code from last code challenge?!

3 Answers

Erik McClintock
Erik McClintock
45,783 Points

Mohsen,

In this case, assuming you're referring to the first task in the challenge, they are simply asking for you to select all images generically; not via a class or ID.

Thus, you would do the following for the first task:

img {
max-width: 100%;
}

Hope this helps!

Erik

Erik McClintock
Erik McClintock
45,783 Points

Remember: you can also style elements based on their element type, if you want to apply those styles to all the elements of said type. So, for example here, if you know you're going to want all of your images to be responsive, then setting all images with the img tag to have a max-width of 100% is easier than going through and applying a class to each image to achieve the same result.

Erik

Mohsen Qaddoura
Mohsen Qaddoura
22,237 Points

Thank you Erik. After I sent the question for discussion, it occurred to me to do exactly just that. I think just by formulating the question/problem and writing it down helped me to see things more clearly. I have already moved way past this stage now. Still it was useful to follow your line of thought in your generous answer.

Mohsen Qaddoura
Mohsen Qaddoura
22,237 Points

But still I hold my opinion, the html file should have been included, as this is the norm, you wouldn't code your css without having access to html code!

Erik McClintock
Erik McClintock
45,783 Points

Glad to hear you were able to resolve your issue! And yes, indeed, sometimes forming the problem into written or even spoken words can help debug it.

Happy coding!

Erik

Mohsen Qaddoura
Mohsen Qaddoura
22,237 Points

Wish you Happy coding too. I do enjoy learning and coding in all the programming languages I went through so far from C to JavaScript with some of its spin offs, Ruby, Python and of course HTML5, CSS to even the Frankenstein of programming languages PHP inspite of its inconsistency and inherent bugs!