SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Sep 2004
    Location
    uk
    Posts
    240
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    why doesn't this code validate??

    Hi,

    i can't figure out why i'm getting errors when i try to validate my xhtml.
    I've included the code below with the 2 errors that i need to sort out.

    Any help with this will be greatly appreciated.

    Thanks

    janice

    -------------------------------CODE
    <body>
    <script type="text/javascript" src="http://www.makepovertyhistory.org/oneband/oneband_small_right.js"></script>
    <noscript><a href="http://www.one.org/">http://www.one.org</a></noscript>

    <div id="outer">
    <div id="skip">
    <p><a href="#middle" accesskey="s" title="Skip to page content - Access Key s">Skip to content</a></p>
    </div>

    <noscript><a href="http://www.web address.co.uk/accessibility.php" accesskey="0" title="click here for our access key details">Read our access key details - uk government access keys compliant</a>
    </noscript>

    ------------------------ERRORS FOR XHTML STRICT.
    Error Line 13 column 39: document type does not allow element "a" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.
    <noscript><a href="http://www.one.org/">http://www.one.org</a></noscript>


    Error Line 18 column 88: document type does not allow element "a" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.
    ...rces/accessibility.php" accesskey="0">Read our access key details - uk govern

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Either put the "a" tags that are in the noscript tags in p or div tags.

    ie. <p><a></a></p>

  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's right. In Strict doctypes (HTML 4.01 Strict, XHTML 1.0 Strict or XHTML 1.1), the noscript element can only contain block-level elements. Anchors are inline-level.

    HTML Code:
    <noscript><p><a href="http://www.one.org/">http://www.one.org</a></p></noscript>
    Birnam wood is come to Dunsinane

  4. #4
    SitePoint Addict
    Join Date
    Sep 2004
    Location
    uk
    Posts
    240
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you...that's worked.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •