I’m trying to order some lines created with li tag using Dreamweaver. clear: both does the job well and looks fine in Dreamweaver. But when I validate the code I’m getting some errors similar to these:
Line 65, Column 53: document type does not allow element "div" here; assuming missing "li" start-tag
<div style="clear: both; background: none; "></div>
Line 73, Column 12: document type does not allow element "li" here; missing one of "ul", "ol", "menu", "dir" start-tag
<li>
My code is here: http://sudrap.org/paste/text/90799/
Using the
divthere is semantically incorrect.The
ulandolelements can only haveli‘s as children nodes. Theli‘s may have other types of elements though.The CSS pseudo-selector
:aftershould do the trick for you here.Or you can use another variation of it, but I think it is what fits the bill for what you’re asking.
Try this:
li:after {clear: both; }