tags?
Inline elements such as <a>
are often contained within block-level elements such as <p>
. The block elements provide the structure needed to present your data.
You can't wrap a block element with an inline element. You have to do this in that way:
<p><a href=''>Link Description</a></p>
This is W3C standard. Check this!
The first example is only allowed in HTML5.
The second example is allowed in all versions of HTML/XHMTL.
As of HTML 5, anchor tags (<a></a>
) are allowed to wrap around almost anything, including paragraphs. So either example is valid, although I tend to prefer having anchors inside paragraphs.
anchors (a) should be inside a block element. So
<p><a>...</a></p>
I always put the <p>
tags inside unless the amount of text is large.