Support » Fixing WordPress » Centering an image

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Well, which is it? Do you want to center it or to get text to wrap around it? Text can’t wrap around it if it’s in the center, unless you’re doing two columns of text or something like that.

    and getting two columns of test to wrap nicely around an image can be a little work depending on what you are looking for.

    to get text to wrap around an image, use a float in the css:

    img.left { float left; }

    to center an image you can use the text align in the parent or you can use auto margins on the image (or both):

    #parent { text-align: center; }

    or

    img.center { margin: 0 auto; }

    If you are doing this in a post in wordpress click on the image after adding it to the post and then click on either the center alignment button or the left or right alignments.

    Maybe that will give you some direction…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Centering an image’ is closed to new replies.