Multiple IMG "styles"

Registered User
25 posts

I have a site where every image in the #content is to have aborder and so the stylesheet shows:
#content img {
padding: 5px;
border: 1px solid #0098a6;
Works fine.
Now I have just one IMG that I want to have no border, only one in the entire site. I can't seem to make it happen. Any suggestions?

Senior Advisor
1,625 posts

Can we have a link to your site? It would help us find the issue. :D
"An Apple doth not fall far from its tree, yet an orange does." - Responsive Web Design & Web Hosting Services. - HTML5, CSS3 and CC Help Video Blog.

Senior Advisor
10,516 posts

if you give that particular image a class of it's own you would give it something like:

<img class="classnamehere" src...... etc.>

Then in your css do this:

.classnamehere {
padding: 5px;
border: 0;

If that doesn't work (I didn't test to see if images can contain a class so I'm just assuming so lol) try putting the image within a <div> tag and giving the div the class instead.
Jo Ann

Some websites created by Elements in Webdesign: - A friends site I created to help raise awareness to help stray cats in her area. - the local Literacy Council in my city. - one of the local hair dressers in my town. - Dedicated to a friend who recently passed away from Lung Cancer.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.