Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter skyyypilot

    (@skyyypilot)

    sorry, the web page is:
    https://www.acecars.net/?p=18

    Try adding:

    .aligncenter {
    	display: block;
    	margin-left: auto;
    	margin-right: auto;
    }
    .alignleft {
    	float: left;
    }
    .alignright {
    	float: right;
    }

    to your theme’s stylesheet.

    Thread Starter skyyypilot

    (@skyyypilot)

    Thx for the suggestion, but all images with captions are shown left justified (even if I specify none, center, or right).

    First, I’d run your HTML and CSS through the validator, since I’m noticing a lot of errors (for example, class=”margin-left: 20px;” isn’t the proper way to specify a style–should be style=”margin-left: 20px;”)

    https://validator.w3.org/

    Second, add the code esme posted to your theme’s stylesheet, because there’s no defaults set for those classes. When you align an image to the center, it adds the class=”aligncenter” attribute to the image, which then references the stylesheet and looks for that class’ properties.

    The un-captioned images are centered in this case because the paragraph tags around them have the text-align: center property applied, but it’s better to do it the way esme suggested.

    Thread Starter skyyypilot

    (@skyyypilot)

    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Images with captions are not centered.’ is closed to new replies.