center an image with theme that floats everything left

4 replies
  • WEB DESIGN
  • |
What code can I put in specific posts in wordpress when I insert an image I want centered but the rest of the theme floats all images to the left.

I want to keep the default float left on the theme, except for the one image I put in a post, that one I want to center.

Can someone give me example in html code?
#center #floats #image #left #theme
  • Profile picture of the author 365Daysof
    It's not so much HTML as inline CSS:

    <p style="text-align: center;"><imc src=...></p>

    OR

    <div style="text-align: center;"><imc src=...></div>

    OR

    <div style="margin: 0 auto;"><imc src=...></div> (where auto is the horizontal, it could also be 0 100px; or whatever)
    {{ DiscussionBoard.errors[3685364].message }}
  • Profile picture of the author socialbookmark
    Also you can use this simple code ( But above codes are more recommended )
    <center> <imc src=...> </center>
    Signature

    I love warriorforum. zendegiyesabz

    {{ DiscussionBoard.errors[3685370].message }}
  • Profile picture of the author haymanpl
    Just click on the image after you have inserted it into your post and change the alignment to centre
    {{ DiscussionBoard.errors[3696164].message }}
  • Profile picture of the author websitedesign1
    Thanks for sharing.
    {{ DiscussionBoard.errors[3696480].message }}

Trending Topics