View Full Version : Caption alignment

05-29-2012, 12:05 AM

Is there a reason, please, why the caption is not centered (please see attachment).

This is the code I have:
<style type="text/css">
.picture {
padding: 2px;
font: 11px Verdana, Arial; }
.picture img {
vertical-align:middle; margin-bottom: 1px;}

a:link {

text-decoration: none;}

a:visited {

text-decoration: none;}

a:hover {

text-decoration: underline;}



<div class="picture" style="width:216px;"> <img src="Web_chat.gif" width="216" height="154" alt="Chat" /> <br />

<a href="default.html" target="popup" onclick="window.open('default.html', 'popup', 'width=450,height=550'); return false">Click for live chat</a></div>


I thought the middle alignment would have done it?


05-29-2012, 12:16 AM
You want the caption centered under the image correct? You could just put an align="center" in your a tag for the link.

If you want it along side the image you could just float the image either left or right in your styles.

05-29-2012, 12:26 AM
This did it:

<div class="picture" style="text-align: center;" style="width:216px;"> <img src="Web_chat.gif" width="216" height="154" alt="Chat" /> <br />

Many thanks!

05-29-2012, 02:59 AM
You should combine the two style attributes together - or better just apply them as part of either the picture class or as a second class applied to that same tag.

05-29-2012, 10:34 AM
Hello felgall

Yes, this works as well:

[CODE]<div class="picture" style="text-align: center; width:216px;"><img src="Web_chat.gif" width="216" height="154" alt="Chat" /> <br />

Thanks a lot.