homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

W3C Validation for a Centered Google Ad

 11:50 pm on Oct 31, 2011 (gmt 0)

Hello there,

Is anyone having problems with the W3C validation?
It is being a bit annoying now.
Can anyone explain to me how to center a Google Add in a module, part of a CMS, with script tags without getting penalized by the W3C scheme?

Note that you can not use <center>, <div> and <p>




 10:31 am on Nov 1, 2011 (gmt 0)

The <center> tag is deprecated (since it is presentational) and <p> can only contain certain other elements since it is primarily intended for a paragraph of text. The <div> element is probably the one to go for, but it will depend on the context where it is to be used. You might even be able to center the Goodle-Ad using existing elements?

You could perhaps post the resulting markup to see what we have to work with, but I suspect this is more of a CSS issue than an HTML one?


 6:25 pm on Nov 1, 2011 (gmt 0)

Wrap it in a div, as mentioned, with margin:auto? text-align:center is likely to give you grief as that is, of course, for text and inline elements 9it will center things inside it you may not want centered.)


 10:07 pm on Nov 3, 2011 (gmt 0)

Put the entire ad script within a div and make the div align center. if you want to add the script through a cms just click on the source code and then add a div into it.


 10:12 pm on Nov 3, 2011 (gmt 0)

I recently had issues getting a Google Maps iframe to validate and came up with the followig solution for XHTML 1.0 Strict validation:

<object style="width: 855px; height: 500px; border: 4px" data="http://example.co.uk/"></object>


 4:05 pm on Nov 4, 2011 (gmt 0)

div align center

The align attribute is deprecated in HTML 4,5, and XHTML, along with <font>, <center>, and others. Margin:auto is usually a good substitute. It will still "work," it just won't validate.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved