Results 1 to 3 of 3

Thread: w3c validation question #2

  1. #1
    Join Date
    Apr 2012
    Location
    Central New Jersey
    Posts
    138
    Thanks
    51
    Thanked 0 Times in 0 Posts

    Default w3c validation question #2

    Following are two excerpts. The first excerpt is from a page on my site, beginning with the </head> tag. The second excerpt is from the w3c validator results for that page. The validator is flagging my use of the anchor, but I fail to understand why. Is it because it's in a table element? I use anchors in table elements elsewhere with no difficulty. The validator explanation gives example of <style> element in <body> section, but my reference book seems to allow that.

    Assistance sought.

    A.

    EXCERPT ONE:

    Code:
    </head>
    
    <body>
    
    
    
    <div id="container">
    
    <div id="logo">
    
    <table>
    <tr>
    
    <td class="logoleft"><span class="heading">Criminal Lawyers in New Jersey&trade;</span><br />
    Click <a href="http://www.MarainLaw.com/quest"><span style="color : #ff4040; ">Here</span></a> for Your Confidential No-Obligation Case Evaluation</td>
    <td class="logoright">
    Law Offices of Allan Marain<br />
    Counsellors at Law<br />
    <a href="http://maps.google.com/maps?f=q&amp;hl=en&amp;q=100+Bayard+Street,+New+Brunswick+NJ+08901-2165" target="_blank" onclick="popwin('http://maps.google.com/maps?f=q&amp;hl=en&amp;q=100+Bayard+Street,+New+Brunswick+NJ+08901-2165'); return false">100 Bayard Street</a><br />
    P.O. Box 1030<br />
    New Brunswick NJ 08903<br />
    
    732-828-2020<br />
    or Toll Free: 877-652-6531<br />
    e-mail:  <a href="mailto:info@MarainLaw.com">Info@MarainLaw.com</a></td>
    </tr>
    </table>
    
    </div>
    
    <div id="wrapper">
    
    <div id="content">
    EXCERPT TWO:


    1. Error Line 7, Column 50: document type does not allow element "a" here

    … href="http://www.MarainLaw.com/quest"><span style="color : #ff4040; ">Here</s…



    The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

    One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).
    Last edited by jscheuer1; 04-29-2012 at 05:06 AM. Reason: Format

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,076
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    That can't possibly be line 7. It's referring to this in the head which is obviously invalid (from the page's source code):

    Code:
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    
    <title>New Jersey Criminal Defense Lawyer
     - Click <a href="http://www.MarainLaw.com/quest"><span style="color : #ff4040; ">Here</span></a> for Your Confidential No-Obligation Case Evaluation</title>
    Just get rid of the highlighted section, it probably got there by accident anyway.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    marain (04-29-2012)

  4. #3
    Join Date
    Apr 2012
    Location
    Central New Jersey
    Posts
    138
    Thanks
    51
    Thanked 0 Times in 0 Posts

    Default

    It was by semi-accident. My PHP designer caused the subtitle to echo both in the body as well as in <title>, probably for SEO enhancement. No, I cannot validly attribute that error to him. That subtitle was an addition that unsuspecting I made.

    Thank you.

    A.

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
  •