HTML and CSS Reference
In-Depth Information
<link rel="bookmark" title="About" href="about/" />
<link rel="bookmark" title="Services" href="services/" />
<link rel="bookmark" title="Portfolio" href="portfolio/" />
<link rel="bookmark" title="Contact" href="contact/" />
The author of the document can be declared similarly (Listing 3-46).
Listing 3-46. A Link to the Author
< link rel="author" > href="http://www.example.com/" />
The favorites icon (favicon 18 ), a 16×16 pixel square icon by default, can be determined by the shortcut icon or
icon link (Listing 3-47). The first one is supported in all browsers; however, it is not declared in HTML specifications.
Listing 3-47. A Link to the Web Site Icon
< link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
Although the default image format is ICO, modern browsers support other formats too such as PNG, animated
PNG, JPEG, GIF, animated GIF, and SVG. They can be used in the form shown in Listing 3-48.
Listing 3-48. Link Examples for rel="icon"
< link rel="icon" type="image/vnd.microsoft.icon" > href="http://www.example.com/image.ico" />
< link rel="icon" type="image/png" > href="http://www.example.com/image.pgn" />
< link rel="icon" type="image/gif" > href="http://www.example.com/image.gif" />
Since the attribute value icon was not standardized until HTML5 and browser support varies, it is a common
practice to declare the same icon file with both the shortcut icon and icon attribute values.
Tip
The files can also be 32×32, 48×48, or 64×64 pixels in size with 8-, 24-, or 32-bit color depth. However, because
of the different browser support, the preferred format for favicons is the de facto file name and type ( favicon.ico )
provided in the root directory of the web site. Note that the larger the resolution and color depth, the longer the
download time. File size should be kept within reasonable limits (see Chapter 9 for more on this).
The rel attribute is often used in other contexts as well. The microformats rel="license" , rel="nofollow" ,
and rel="tag" , for example, provide various metadata on (X)HTML elements, most commonly on the a element.
Generally they are parts of the document body but are used for specific purposes; thus, they are described later in
Chapter 7.
In the XHTML document head, further attribute values can also be used from namespaces other than the default
XHTML namespace. Listing 3-49 shows an example for that.
Listing 3-49. Linking to an Additional Namespace
< link rel="foaf:primaryTopic" type="application/rdf+xml" title="FOAF"
href="http://www.example.com/metadata/foaf.rdf" />
18 Also known as bookmark icon, URL icon, shortcut icon, or web site icon
 
 
Search WWH ::




Custom Search