Blog

Image in entries styling

This post is to address Josie’s question 🙂

The reason why your IMG CSS isn’t working on this one is because I’ve kind of specified it that way 🙂 Not because I’m a selfish prick, but I really had no idea that I will be making my graphics as background images before I started creating the code from my design in Photoshop. Anyway, you could still put IMG styling regardless of which. You just need to modify it a bit.

This is your code:

Img {
margin: 5px;
padding: 10px;
border: solid black 1px
}

To use this styling on images in the posted entry, you have to specify the class name of my formatting for the entry text. Try this:

.entrytext img {
margin: 5px;
padding: 10px;
border: solid black 1px
}

“.entrytext” is the class name I made for the styling of the posted entry text DIV. So basically, what this CSS code means to say is “everytime there’s an IMG within this DIV, I will apply the CSS Josie created.” The good thing about this is that if you have other images contained in different DIVs, they won’t be affected. Specifying “.entrytext” before the IMG assures you that the styling will only be applicable to the “.entrytext” DIV. This same concept applies if you want to change link styles, codes, numbered lists, ordered lists, etc. within the post.

I hope that helps! 🙂

Let's talk!

Do you need help deciding which website package is best for you? Get a quote below!
For other inquiries, click here to send me a message.