marain
04-28-2012, 08:07 PM
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:
</head>
<body>
<div id="container">
<div id="logo">
<table>
<tr>
<td class="logoleft"><span class="heading">Criminal Lawyers in New Jersey™</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&hl=en&q=100+Bayard+Street,+New+Brunswick+NJ+08901-2165" target="_blank" onclick="popwin('http://maps.google.com/maps?f=q&hl=en&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).
Assistance sought.
A.
EXCERPT ONE:
</head>
<body>
<div id="container">
<div id="logo">
<table>
<tr>
<td class="logoleft"><span class="heading">Criminal Lawyers in New Jersey™</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&hl=en&q=100+Bayard+Street,+New+Brunswick+NJ+08901-2165" target="_blank" onclick="popwin('http://maps.google.com/maps?f=q&hl=en&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).