Images NOT centred inside the caption (5 posts)

  1. gwileswp
    Posted 2 years ago #

    The caption on my image is aligned left - but I want it centred.
    here is th ecode

    [caption id="attachment_914" align="alignright" width="315"]<img class=" wp-image-914 " alt="Sophie and Sabina from PA Business Support" src="http://www.pabusinesssupport.co.uk/wp-content/uploads/SophandSabina.jpg" width="315" height="225" /> Lunching with my colleague Sabina[/caption]

    I have tried adding this code to the style sheet:
    .wp-caption img {
    margin: 0 auto!important;
    padding: 0!important;
    border: 0 none!important;

    I added it above
    caption, th, td {

    font-weight: normal;

    text-align: center;


    but no change
    what should I add where?

  2. ManuelGarciaPH
    Posted 2 years ago #

    It would be better if there is a demo page or the actual page for us to be seen so we can experiment easily.

  3. Michael
    Forum Moderator
    Posted 2 years ago #

    .wp-caption p { text-align: center; }
  4. gwileswp
    Posted 2 years ago #

    Thank you
    This is the page:
    and thanks for the code - but I am not sure where to insert it - in the theme editor / style sheet? where exactly?
    Thank you

  5. Andrew Nevins
    Forum moderator
    Posted 2 years ago #

    We don't know either because it looks like you're using a custom-built theme.

    The way I normally recommend is to install this Custom CSS Manager plugin http://wordpress.org/plugins/custom-css-manager-plugin

    Then use its "CSS Code" section of the dashboard to hold your CSS modifications.

Topic Closed

This topic has been closed to new replies.

About this Topic