If the styling for captions in Wordpress 2.6 doesn’t seem to work…
I had some trouble getting the captions to look good in Wordpress 2.6. Here’s how I solved it.
First, I added this code from the default theme to my style sheet:
/* Captions */
.aligncenter,
div.aligncenter {
display: block;
margin-left: auto;
margin-right: auto;
}
.wp-caption {
border: 1px solid #ddd;
text-align: center;
background-color: #f3f3f3;
padding-top: 4px;
margin: 10px;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
.wp-caption img {
margin: 0;
padding: 0;
border: 0 none;
}
.wp-caption p.wp-caption-text {
font-size: 11px;
line-height: 17px;
padding: 0 4px 5px;
margin: 0;
}
/* End captions */
That should have done the trick, but it didn’t. The problem was, the default CSS file has code for .alignright and .alignleft elsewhere, and mine doesn’t. So if the above code doesn’t work, what you need to add somewhere – anywhere in your CSS file – is:
.alignright {
float: right;
}.alignleft {
float: left
}
That worked for me.
Related posts:
Categories:
Tags: |