Forums

[resolved] Centering images causes W3C validation issues (6 posts)

  1. jmills87
    Member
    Posted 9 months ago #

    Alright, so when I center images on my blog http://iphoneblogr.com it causes W3C to display errors. The error I get is:

    Line 220, Column 10: end tag for "p" omitted, but OMITTAG NO was specified

    And here is the HTML from my post. As you can clearly see there is an end tag </p> in the post so I don't know why I am getting this error.... it happens on all posts that have centered images.

    http://pastebin.com/ChCT5zMt

    Any ideas?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 9 months ago #

    Then choosing align centre when inserting your images.

  3. jmills87
    Member
    Posted 9 months ago #

    When I chose center alignment in the media uploader screen, it centers the image in the backend, but when I publish the post, the images are not centered on the actual post.

  4. jmills87
    Member
    Posted 9 months ago #

    The W3C error is gone now that I did aligncenter instead of div textalign center, but the images are not centered as you can see here:

    http://iphoneblogr.com/2011/08/comex-has-been-hired-by-apple-as-an-intern/

  5. esmi
    Theme Diva & Forum Moderator
    Posted 9 months ago #

    Then you probably need to add some classes to your theme's stylesheet.

    .aligncenter {
    	display: block;
    	margin-left: auto;
    	margin-right: auto;
    }
    .alignleft {
    	float: left;
    }
    .alignright {
    	float: right;
    }
  6. jmills87
    Member
    Posted 9 months ago #

    Thanks esmi that did it! Images are now center aligned and the site still passes W3C validation. You're the best!

Reply

You must log in to post.

About this Topic

Tags