6.2 a
Element
To implement a link, you’ll need to use the a
element. Here’s an example a
element that implements a link to Park University’s website:
<a href="http://www.park.edu">Park University</a>
The text that appears between an a
element’s start tag and end tag forms the link label that the user sees and clicks on. So in this code, the link label is “Park University.” By default, browsers display link labels with underlines. So this code renders like this:
Park University
The blue color indicates that the linked-to page has not been visited. We’ll discuss visited and unvisited links later on.
When the user clicks on a link, the browser loads the resource specified by the href
attribute. For this example, the “resource” is another web ...
Get Web Programming with HTML5, CSS, and JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.