Chapter 7: All About Links
The major capability of Web pages besides displaying text, graphics, and media is loading other pages. Using Web pages, people — including designers and developers — tend to think of going somewhere or getting something. We even think of helping users with site maps and navigation tools that imply that they’re on some kind of trip. The navigational issues are important and are discussed in Chapter 8.
However, this chapter looks at how links load other Web pages, as well as how they’re used to access alternate style sheets. Included in this examination are the different attributes that are related to loading pages, the details of accessing a page, and CSS3 properties used to both style links and to launch interactive features in those properties.
The Link Element and Its Key Attributes
The major link element is the a
element. So, most of this chapter will focus on the <a>
tag. However, before doing that, the <link>
tag is important to consider. It, too, loads pages, and while the files loaded using the link
element cannot be seen, they’re an important kind of data-loading feature that needs to be understood for optimum use.
The attributes used with both <a>
and <link>
tags share attribute characteristics with all HTML5 elements, so they can be treated just like an attribute for <h1>
, <body>
, or any other HTML5 tag. However, the attributes used with link elements tend to focus on loading files (.html
, .css
, and .js
) rather than on appearance.
The link ...