Hi, I’m trying to keep my site valid in the w3 validator but this error is coming up and i’m not sure what it means or how to fix it.
Line 59, Column 128: document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag
The mentioned element is not allowed to appear in the context in which you’ve placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you’ve forgotten to close a previous element.
One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>")
the elements in your page are put into 2 camps – Block elements and Inline elements. For it to validate you can not put a block element inside an inline element.
As a rough rule, the block elements are those that would render under each other by default, like DIV’s for example or P’s or UL… an inline element is something that stays inline – like a SPAN or an A.
You have a DIV there in your A. :) If you want the A to behave like a block element you can style it with display:block; If you need it to stay "inline" you can use display:inline-block; (IE you might have to float it as it is stupid ;) )
Hope that helps.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.
*May or may not contain any actual "CSS" or "Tricks".