4.5. In-line Elements

4.5.1. Emphasizing Information

Two levels of emphasis are available in XHTML, em and strong. em is for a normal level of emphasis and strong indicates stronger emphasis.

Typically, em is rendered in italic and strong is rendered in bold. This is not always the case, however, and should not be relied upon. According to best practices, webpages only hold structural and semantical information and stylesheets are later applied to them. Think of semantics, not formatting, when using these tags.

Example 4.13. em and strong

Usage:

<p><em>This</em> has been emphasized, while <strong>this</strong> has been strongly emphasized.</p>

4.5.2. Indicating Fixed-Pitch Text

Content that should be rendered in a fixed pitch (typewriter) typeface is tagged with tt (for teletype).

Example 4.14. tt

Usage:

<p>This document was originally written by Nik Clayton, who can be reached by email as <tt>nik@FreeBSD.org</tt>.</p>

4.5.3. Links

Note:

Links are also inline elements.

4.5.3.1. Linking to Other Documents on the Web

A link points to the URL of another document on the web. The link is indicated with a, and the href attribute contains the URL of the target document. The content of the element becomes the link, and is normally indicated to the user in some way, typically by a different color or underlining.

Example 4.15. Using <a href="...">

Usage:

<p>More information is available at the <a href="http://www.FreeBSD.org/">FreeBSD web site</a>.</p>

These links will take the user to the top of the chosen document.

4.5.3.2. Linking to Other Parts of Documents

Linking to a point within another document, or within the same document, requires that the document author include anchors. Anchors are indicated with a and the id attribute instead of href.

Example 4.16. Using <a id="...">

Usage:

<p><a id="para1">This</a> paragraph can be referenced in other links with the name <tt>para1</tt>.</p>

To link to a named part of a document, write a normal link to that document, but include the ID of the anchor after a # symbol.

Example 4.17. Linking to a Named Part of Another Document

Assume that the para1 example resides in a document called foo.html.

<p>More information can be found in the <a href="foo.html#para1">first paragraph</a> of <tt>foo.html</tt>.</p>

If you are linking to a named anchor within the same document then you can omit the document's URL, and just include the name of the anchor (with the preceding #).

Example 4.18. Linking to a Named Part of the Same Document

Assume that the para1 example resides in this document:

<p>More information can be found in the <a href="#para1">first paragraph</a> of this document.</p>

This, and other documents, can be downloaded from http://ftp.FreeBSD.org/pub/FreeBSD/doc/

For questions about FreeBSD, read the documentation before contacting <questions@FreeBSD.org>.

For questions about this documentation, e-mail <doc@FreeBSD.org>.