I have created this piece of code.
<a href="#">
<!-- BEGIN #btnBox .btnBox -->
<div id="btnBox2" class="btnBox">
<div class="btnleft"></div> <!-- BEGIN & END .btnleft -->
<!-- BEGIN .btncenter -->
<div class="btncenter">
<div id="btnText2" class="btnText">Want more? - check out my recent work</div>
</div>
<!-- END .btncenter -->
<div class="btnright"></div> <!-- BEGIN & END .btnright -->
</div>
<!-- END #btnBox .btnBox -->
</a>
And when I validate the code under W3 HTML validation, it’s giving me an error:
Line 163, Column 41: document type does not allow element "DIV" here; missing one of "OBJECT", "MAP", "BUTTON" start-tag
I am using
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
A division
<div>is a block level element while an anchor<a>is an inline element. From the w3c web site:Chances are you’re using divisions because you need block-level behavior, like
widthandheight.Without changing your DOCTYPE, you can use the CSS property
displayto make<span>elements behave like<div>elements:HTML
CSS