Possible Duplicate:
Which is more correct: <h1><a>..</a></h1> OR <a><h1>..</h1></a>
Semantically, which is more correct: a in h2, or h2 in a?
This is a simple question about HTML. What is the right/most preferable way to put a link in a header, paragraph or another HTML element?
This way:
<h2><a href="">Some Title</a></h2>
Or this way:
<a href=""><h2>Some Title</h2></a>
Better is
<h2><a href="">Some Title</a></h2>
because h
is element with display block and is not good practice to have block
in a
element.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With