Reputation: 23
I am wanting to make my code compliant,
<!DOCTYPE html>
I am using something like this,
<a href='#'>
<div> Stuff </div>
</a>
But it is clear that compliance wants something more like,
<div>
<a href='#'> Stuff </a>
</div>
Is there a way to implement the above code in a compliant way?
When i mean 'Stuff' i mean other divs or text.
My code works without the specification of doctype, but once I do weird things happen.
Upvotes: 2
Views: 63
Reputation: 665
According to the W3C a div
may not live inside an a
element, unless you're declaring the doctype as HTML5. HTML5 allows a
elements to contain blocks.
Upvotes: 3