what is the best way to make a link in html
i mostly use html4 but im trying to implement html5
so my question is basically what should be the wrapping tag, the p or a?
this:
<p class="center">
<a href="#">
<img src="addToCart.png">
</a>
</p>
or this:
<a href="#">
<p class="center">
<img src="addToCart.png">
</p>
</a>
thanks.
Under HTML 4.1 an
aelement,display: inlineby default, cannot contain a block-level element, such as ap; thereforepshould wrapa.If, though, you’re using HTML 5, and have
<!doctype html>, then either way is acceptable (and valid), so use whichever you find best meets your requirements.