Which is right? This:
<h2>heading 2</h2>
<p><a href="#" target="_blank" title="Opens in a new window">link 1</a></p>
<h2>heading 2 </h2>
<p><a href="#" target="_blank" title="Opens in a new window">link 2</a></p>
<h2>heading 2 </h2>
<p><a href="#" target="_blank" title="Opens in a new window">link 3</a></p>
<h2>heading 2 </h2>
<p><a href="#" target="_blank" title="Opens in a new window">link 4</a></p>
or this:
<h2>heading 2</h2>
<a href="#" target="_blank" title="Opens in a new window">link 1</a>
<h2>heading 2 </h2>
<a href="#" target="_blank" title="Opens in a new window">link 2</a>
<h2>heading 2 </h2>
<a href="#" target="_blank" title="Opens in a new window">link 3</a>
<h2>heading 2 </h2>
<a href="#" target="_blank" title="Opens in a new window">link 4</a>
@Jitendra, I agree with your point .. but only if you are using strict.dtd (HTML/XHTML)
According to W3C recommendation(for strict dtd) .. the tag
<a>must be used in a block element.Look at the following example:
The above code produces error while doing HTML validation .. saying
Making the dtd as loose/transitional you can get rid of the error .. For Strict HTML or Strict XHTML this error is obvious ..
Hope it helped .. 🙂
regards-Infant Pro