try to add !important to override default values so it will be
.wp-caption img {
border: 1px solid #e7e7e7 !important;
margin: 0;
padding: 0;
}
I tried that but still no border! Thanks anyway.
Just make sure that the container before the <img> is “.wp-caption” class. something like this
<div class="wp-caption">
<img /> //image under wp-caption class container
</div>
You can use Firebug or similar
Hope that helps
.wp-caption img {} will only style images with a caption text;
try (untested without a live link to the problem):
.hentry img { border: ....; }
try to use Firebug http://getfirebug.com/ or a similar browser tool to investigate these kind of formatting problems.
I was just looking at the style.css coding for the image, not the whole element (ie. image and caption). After finding this I was able to change the settings for the border. Not so hard after all!
Just wondering is it possible to put a border around the image only or would I have to do that before adding the caption?
The border around both is being set by this:
.wp-caption {
background: none repeat scroll 0 0 #F3F3F3;
border: 1px solid #DDDDDD;
margin: 0 5px;
padding: 2px;
text-align: center;
}
You don’t have any border set for the image only — it would go in this CSS:
.wp-caption img {
border: 0 none;
margin: 0;
padding: 0;
}
The above sets a border on images that are inside elements with the .wp-caption class.