HTML, XHTML and CSS All-In-One for Dummies - Andy Harris [40]
♦ Table-based layouts cause problems for screen-readers. People with visual disabilities use special software to read Web pages. These screen-readers are well adapted to read tables as they were intended (to manage tabular data), but the screen-readers have no way of knowing when the table is being used as a layout technique rather than a data presentation tool. This makes table-based layouts less compliant to accessibility standards.
Resist the temptation to use tables for layout. Use tables to do what they’re designed for: data presentation. Book III is entirely about how to use CSS to generate any kind of visual layout you might want. The CSS-based approaches are easier, more dependable, and much more flexible.
Chapter 5: Making Connections with Links
In This Chapter
Understanding hyperlinks
Building the anchor tag
Recognizing absolute and relative links
Building internal links
Creating lists of links
The basic concept of the hyperlink is common today, but it was a major breakthrough back in the day. The idea is still pretty phenomenal, if you think about it: When you click a certain piece of text (or a designated image, for that matter), your browser is instantly transported somewhere else. The new destination might be on the same computer as the initial page, or it could be literally anywhere in the world.
Any page is theoretically a threshold to any other page, and all information has the ability to be linked. This is still a profound idea. In this chapter, you discover how to add links to your pages.
Making Your Text Hyper
The hyperlink is truly a wonderful thing. Believe it or not, there was a time when you had to manually type in the address of the Web page you wanted to go to. Not so anymore. Figure 5-1 illustrates a page that describes some of my favorite Web sites.
In Figure 5-1, the underlined words are hyperlinks. Clicking a hyperlink takes you to the indicated Web site. Although this is undoubtedly familiar to you as a Web user, a few details are necessary to make this mechanism work:
♦ Something must be linkable. Some text or other element must provide a trigger for the linking behavior.
♦ Things that are links should look like links. This is actually easy to do when you write plain XHTML because all links have a standard (if ugly) appearance. Links are usually underlined blue text. When you can create color schemes, you may no longer want links to look like the default appearance, but they should still be recognizable as links.
♦ The browser needs to know where to go. When the user clicks the link, the browser is sent to some address somewhere on the Internet. Sometimes that address is visible on the page, but it doesn’t need to be.
♦ It should be possible to integrate links into text. In this example, each link is part of a sentence. It should be possible to make some things act like links without necessarily standing on their own (like heading tags do).
♦ The link’s appearance sometimes changes. Links sometimes begin as blue underlined text, but after a link has been visited, the link is shown in purple, instead. After you know CSS, you can change this behavior.
Of course, if your Web page mentions some other Web site, you should provide a link to that other Web site.
Figure 5-1: You can click the links to visit the other sites.
Introducing the anchor tag
The key to hypertext is an oddly named tag called the anchor tag. This tag is encased in an set of tags and contains all the information needed to manage links between pages.
The code for the basicLinks.html page is shown here:
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
Some of my favorite sites
Wikipedia
One of