-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Responsive Web Design with HTML5 and CSS - Fifth Edition
By :
The a tag (short for anchor tag) is arguably the most important and defining tag of HTML. The anchor tag is the tag used to link from the document a user is on to another document elsewhere on the internet, or another point in the same document.
You can read the specification for the
<a>element here: https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element
A welcome benefit of HTML5 is that we can wrap multiple elements in an a tag. In prior versions of HTML, if you wanted your markup to validate, it was necessary to wrap each element in its own a tag. For example, look at the following code – a heading, a paragraph, and an image all requiring separate a tags to link to a common destination:
<h2><a href="index.html">The home page</a></h2>
<p><a href="index.html">This paragraph also links to the home page</a></p>
<a href="index.html"...