In the comment section of a recently published post someone asked me how to modify image caption text. He wanted to reduce it. I must confess, I am not an HTML or CSS expert, so I resorted to my basic knowledge of HTML and suggested a solution based on that knowledge.
Not having tested it myself, I suggested that the text size of the image caption could be modified by adding <font size=”10″>Caption</font>.
A friend of mine, Sorina, saw the comment and she corrected me and brought to my attention the new changes in coding.
I did a Google search using the query “how to reduce size of image caption in wordpress”. The search results returned the following answer:
The size attribute of <font> is deprecated in HTML 4.01. Use CSS instead. CSS syntax: <p style=”font-size:20px”> Source
I decided to try my original suggestion and see if it still works in WordPress and my updated Canvas theme. Of course, it did not work. Then I applied the <p style=”font-size:20px”> code and, naturally, it worked.
Before the test – default size of the caption
After the test – after adding <p style=”font-size:20px”> before text
Wait there is more – the best is yet to come!
After I finished writing this post I added an image to the top left side of the post. The caption was created in the editor of the media library (as described above). The edited image was uploaded to the WordPress editor of this post that I was writing. After uploading the image I noticed that a mistake was made. I was just about to delete the image when I noticed that my cursor was in the caption section of my image, purely by coincidence.
Well, imagine that. You can change the size of the font of the image right in your editor. Not only that, you can bold it, you can even hyperlink it, you can do pretty well whatever you want with it.
So, was this experiment an exercise in futility. No, not for me. I’ve learned a great deal. And as a bonus, I can share my knowledge with my friends and my readers.
I hope you liked the results of this experiment. If you did please click on the LIKE button below or leave me a comment.