Welcome to WebmasterWorld Guest from 54.211.101.8

Forum Moderators: not2easy

ERROR - document type does not allow element "div" here;

   
9:19 pm on Feb 27, 2011 (gmt 0)



I am getting the following error in an definition list on W3C, and I can't figure out what I'm doing wrong. I have tried many different combinations. Can someone pls help, thanks!

Error:

document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

Code:

<dt><div class="category"> Full Service Facility </div></dt>
<dd>Veterinarians and staff are on duty 24 hours a day, 7 days a week.</dd>
9:30 pm on Feb 27, 2011 (gmt 0)

WebmasterWorld Senior Member



<div class="category">
<dl>
<dt>Full Service Facility</dt>
<dd>Veterinarians and staff are on duty 24 hours a day, 7 days a week.</dd>
</dl>
</div>
9:33 pm on Feb 27, 2011 (gmt 0)

WebmasterWorld Senior Member



Sorry I jumbled your original class a bit but that will give you the clue you need. And welcome to Webmaster World.
9:37 pm on Feb 27, 2011 (gmt 0)



Yea, I tried that. It results in the text (<dd>) "Veterinarians and staff are on duty 24 hours a day, 7 days a week." coming out the same color and font weight as the <dt> I want the <dt> to carry the "category" rules, but not the <dd>
9:43 pm on Feb 27, 2011 (gmt 0)

WebmasterWorld Senior Member



Then have the class "category" style you dt instead of your div
<div class="some_other_category">
<dl>
<dt class="category">Full Service Facility</dt>
<dd>Veterinarians and staff are on duty 24 hours a day, 7 days a week.</dd>
</dl>
</div>
9:56 pm on Feb 27, 2011 (gmt 0)



1st off Seven, right on for the Welcome!

Also, thanks for the help. I have been working on this project for almost 24 straight hours(not this particular issue), starting to get delirious ;) Didn't even need the div, I just <dt class="category">Full Service Facility</dt>, and it's exaclty what I wanted!

Looks like I found my "Web" forum :D
10:22 pm on Feb 27, 2011 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



The theory behind the validation error is that you can't have a block element <div> inside of an inline element <dt>
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month