WordPress.org

Ready to get started?Download WordPress

Forums

XHTML Validation (10 posts)

  1. Alex Cragg
    Member
    Posted 7 years ago #

    having some validation problems. Not sure why, as im using if IEs for css. also the adsense is exactly the same as another button i use, and that validates fine. any pointers would be good.

  2. Adam Brown
    Member
    Posted 7 years ago #

    The issue isn't your CSS validating, it's your HTML. Follow the instructions on the page you linked to.

  3. Alex Cragg
    Member
    Posted 7 years ago #

    yeah i know that. What i meant was i use an if IE to change the css sheet that is displayed, and that if IE statement validates fine.

    So the advice the validator gives is hard to follow when it tells you you are doing it right somewhere else!

    with reference to the adsense button, the xhtml that isnt validating was copied and pasted from an adsense button that is validating on another site of mine.

    This is why i posted! the errors are bemusing and confusing

  4. whooami
    Member
    Posted 7 years ago #

    it's

    <![endif]-->

    not:

    <!--[endif]-->

  5. Alex Cragg
    Member
    Posted 7 years ago #

    yeah, i know its no help when people are looking, but i was playing around to see if that was the problem, you must have looked at a time when it was the second way.

    its now changed back to <![endif]-->.

    when i did change it to the second, incorrect, version though, all the other errors with the goog adsense went away, which makes me think its a prob somewhere with the endif and if Ie bits.

    if you could have another look please?

  6. whooami
    Member
    Posted 7 years ago #

    youre nesting comments.. you might want to look at this:

    http://www.cssplay.co.uk/menu/adsense.html

    the nesting is the tricky part since you need to add more -- things.

  7. Alex Cragg
    Member
    Posted 7 years ago #

    hmmm... i dont seem to be able to work this out. Ive done some googling and found out some more about nesting comments, putting ---- to end one and start another, but my comments are separated by the call for javascript etc.

    the article you suggested didnt really help, maybe i missed the point?

    i got rid of two of the errors by placing the comments in a div as opposed to the div being included in the comments.

    still cant figure this

  8. Adam Brown
    Member
    Posted 7 years ago #

    A hack:

    <script type="text/javascript"><!--
    google_ad_client = "pub-2079691368092450";
    google_ad_width = 110;
    google_ad_height = 32;
    google_ad_format = "110x32_as_rimg";
    google_cpa_choice = "CAAQgcyTlwIaCBn5DarF8MgCKLPGvnUwAA";
    google_ad_channel = "3011547893";
    //--></script>
    <!--[if IE]>
    In a new Web Standards initiative, we recommend upgrading your browser to Firefox2.
    <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    <![endif]-->

    That will get rid of the nested comment structure. You don't need to have the first piece of script inside the IF thing, since it won't do anything without the remote script that follows.

  9. Alex Cragg
    Member
    Posted 7 years ago #

    worked a charm.

    didnt know that adsense javascript worked like that, worth knowing.

    thanks guys and gals

  10. Alex Cragg
    Member
    Posted 7 years ago #

    thought this was resolved until i saw that none of the ads, apart from the one in question, are now showing on my site.

    But seeing my site without the ads made me think it looks better without. But a few here and there wouldn't do any harm, so...

    any other solutions to this? keeping valid XHTML, and displaying other ads?

    thanks guys

Topic Closed

This topic has been closed to new replies.

About this Topic