Prev | Current Page 221 | Next

Craig Grannell

"The Essential Guide to CSS and HTML Web Design"

In its simplest form, an anchor element
looks like this:
A link to the friends of ED
?? website

The href attribute value is the URL of the destination document, which is often another
web page, but can in fact be any file type (MP3, PDF, JPEG, and so on). If the browser can
display the document type (either directly or via a plug-in), it does so; otherwise, it downloads
the file (or brings up some kind of download prompt).
By placing a trailing slash in this type of URL, you make only one call to the server
instead of two. Also, some incorrectly configured Apache servers generate a ???File not
found??? error if the trailing slash is omitted.
THE ESSENTIAL GUIDE TO CSS AND HTML WEB DESIGN
150
There are three ways of linking to a file: absolute links, relative links, and root-relative
links. We??™ll cover these in the sections that follow, and you??™ll see how to create internal
page links, style link states in CSS, and work with links and images. We??™ll also discuss
enhanced link accessibility and usability, and link targeting.
Absolute links
The preceding example shows an absolute link, sometimes called a full URL, which is typically
used when linking to external files (i.e., those on other websites). This type of link
provides the entire path to a destination file, including the file transfer protocol, domain
name, any directory names, and the file name itself. A longer example is
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233