Forum Moderators: open
The DTD is:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
On one site I have two areas of navigation where the same error is repeated again and again. In one I have a two column directory in which I want each individual box to be clickable as opposed to just some of the text within the box.
<div id="leftcol">
<a href="dead-end.html">
<div class="directory">
Pamela Baker
<br />
<p class="update">
Not Located
</div>
</a>
etc.
I've used a div class to set my box and linked the whole box. This is repeated throughout the directory.
It will be a similar fix for the other section most likely where I've linked around <p>
<div id="links">
<a href="directory.html">
<p class="links">
Our Directory
</p>
</a>
etc.
The validator says that the document type does not allow element "DIV" (or "P") here; missing one of "Applet", "Object", "Map", "Iframe", "Button" start-tag.
I tried several of these with horrendous consequences.
What to do?
<div id="links">
<a href="directory.html">
<p class="links">
Our Directory
</p>
</a>
Make sure you end that div tag.
Also, why are you using a <p> tag? You can just apply the class to the <a> tag like so
<a class="links" href="directory.html">
or you don't even have to put that class thing in at all. Just use something like this.
div#links a {
/*whatever is in .links put here/*
}