It’s been at least, oh I don’t know, maybe three people who have asked me how this can be done.
First, I find it best to resize the image to the size you want it before uploading then it’s easier to work with.
Then to add a caption I usually like to add a CSS class and wrap a div around the photo to style it. If that sounds like gibberish then you could just try something like the following code in the HTML part tab of the visual editor:
-
<p style="font-size:90%; font-style:italic; color:#999999;">test code</p>
After each photo. This makes the text 90% of the standard size, in italics and grey/gray.
If you wanted to do this the CSS way, you would add something like this to your themes style.css
-
.photocaption {
-
font-size: 90%;
-
font-style: italic;
-
color: #999999;
-
}
Then in a post would write this:
-
<div class="photocaption">
-
<img src="IMAGE URL HERE" />
-
Caption text here
-
</div>
The text would then be styled as before. Notice the “hard return” before the caption text i.e. it starts on a new line, otherwise the caption text would start next to the photo and not below it. It is possible to automatically wrap text at a certain width, but let’s not confuse matters.
You could of course also set a background colour, float the image right or left and many other things.
Hope that hasn’t confused you too much!
Related posts you may enjoy:
Enjoyed this post? Subscribe via RSS



April 17th, 2008 at 12:30 am
I used the CSS version, but put the style on a span tag, inside the p with the image.
By the way… what are you using the display code? Is it a plugin? I use a Google tool, but it’s kind of slow.
April 17th, 2008 at 8:04 am
Thanks Adrian, probably a more elegant way of doing it, but it all works
For the code I use Dean’s Code Highlighter, I previously tried the Google code but this is excellent.
April 17th, 2008 at 8:08 am
Awesome! Thanks!
June 15th, 2008 at 2:42 am
I have added the subscribe option provided by your site successfully. now i want to know that how could i check my subscribers list. i want to check whom subsribe to my blog.
June 15th, 2008 at 9:08 am
Thanks Muhammad. If you have AWeber it’s simple to check your list by logging in and looking at your subscriber information in Reports.