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

assign an image a class

Hello,

I'm having a mindblock. I'd like to make changes to a particular image. <img src="../../../../Desktop/halsteadtire/images/awdrotation.jpg" alt="awdrotation" width="117" height="213">

where would i insert the class id for this image? i have three images in a row but id like to change how they appear individually.

2 Answers

Hi Evan, you can set an image class and select it like this.

<img class="profile" src="img/profile.jpg" alt="alternate text">
.profile {
    display: block;
}

Thanks Dustin. Just cudnt think of where to stick it. So I can just insert it before the "arc" an it'll work

I'm not sure order matters. This should work also.

<img src="img/profile.jpg" alt="alternate text" class="profile">