aboutsummaryrefslogtreecommitdiff
path: root/en_US.ISO8859-1/books/fdp-primer/xhtml-markup/chapter.xml
blob: eded9cac186544cf77e8f012e209129f5003c93e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Copyright (c) 1998, 1999 Nik Clayton, All rights reserved.

     Redistribution and use in source (SGML DocBook) and 'compiled' forms
     (SGML HTML, PDF, PostScript, RTF and so forth) with or without
     modification, are permitted provided that the following conditions
     are met:

      1. Redistributions of source code (SGML DocBook) must retain the above
         copyright notice, this list of conditions and the following
         disclaimer as the first lines of this file unmodified.

      2. Redistributions in compiled form (transformed to other DTDs,
         converted to PDF, PostScript, RTF and other formats) must reproduce
         the above copyright notice, this list of conditions and the
         following disclaimer in the documentation and/or other materials
         provided with the distribution.

     THIS DOCUMENTATION IS PROVIDED BY NIK CLAYTON "AS IS" AND ANY EXPRESS OR
     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     DISCLAIMED. IN NO EVENT SHALL NIK CLAYTON BE LIABLE FOR ANY DIRECT,
     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE
     POSSIBILITY OF SUCH DAMAGE.

     $FreeBSD$
-->

<chapter id="xhtml-markup">
  <title><acronym>XHTML</acronym> Markup</title>

  <sect1 id="xhtml-markup-introduction">
    <title>Introduction</title>

    <para>This chapter describes usage of the <acronym>XHTML</acronym>
      markup language used for the &os; web site.</para>

    <para><acronym>XHTML</acronym> is the <acronym>XML</acronym>
      version of the HyperText Markup Language, the markup language of
      choice on the World Wide Web.  More information can be found at
      <ulink url="http://www.w3.org/"></ulink>.</para>

    <para><acronym>XHTML</acronym> is used to mark up pages on the
      &os; web site.  It is usually not used to mark up other
      documentation, since DocBook offers a far richer set of elements
      from which to choose.  Consequently, <acronym>XHTML</acronym>
      pages will normally only be encountered when writing for the web
      site.</para>

    <para><acronym>HTML</acronym> has gone through a number of
      versions.  The <acronym>XML</acronym>-compliant version
      described here is called <acronym>XHTML</acronym>.  The latest
      widespread version is <acronym>XHTML</acronym> 1.0, available in
      both <emphasis>strict</emphasis> and
      <emphasis>transitional</emphasis> variants.</para>

    <para>The <acronym>XHTML</acronym> <acronym>DTDs</acronym> are
      available from the Ports Collection in
      <filename role="package">textproc/xhtml</filename>.  They are
      automatically installed by the <filename
	role="package">textproc/docproj</filename> port.</para>

    <note>
      <para>This is <emphasis>not</emphasis> an exhaustive list of
	elements, since that would just repeat the documentation for
	<acronym>XHTML</acronym>.  The aim is to list those elements
	most commonly used.  Please post questions about elements or
	uses not covered here to the &a.doc;.</para>
    </note>

    <note>
      <title>Inline Versus Block</title>

      <para>In the remainder of this document, when describing
	elements, <emphasis>inline</emphasis> means that the element
	can occur within a block element, and does not cause a line
	break.  A <emphasis>block</emphasis> element, by comparison,
	will cause a line break (and other processing) when it is
	encountered.</para>
    </note>
  </sect1>

  <sect1 id="xhtml-markup-fpi">
    <title>Formal Public Identifier (<acronym>FPI</acronym>)</title>

    <para>There are a number of <acronym>XHTML</acronym>
      <acronym>FPI</acronym>s, depending upon the version, or
      <emphasis>level</emphasis> of <acronym>XHTML</acronym> to which
      a document conforms.  Most <acronym>XHTML</acronym> documents on
      the &os; web site comply with the transitional version of
      <acronym>XHTML</acronym> 1.0.</para>

    <programlisting>PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"</programlisting>
  </sect1>

  <sect1 id="xhtml-markup-sectional-elements">
    <title>Sectional Elements</title>

    <para>An <acronym>XHTML</acronym> document is normally split into
      two sections.  The first section, called the
      <emphasis>head</emphasis>, contains meta-information about the
      document, such as its title, the name of the author, the parent
      document, and so on.  The second section, the
      <emphasis>body</emphasis>, contains content that will be
      displayed to the user.</para>

    <para>These sections are indicated with <sgmltag>head</sgmltag>
      and <sgmltag>body</sgmltag> elements respectively.  These
      elements are contained within the top-level
      <sgmltag>html</sgmltag> element.</para>

    <example>
      <title>Normal <acronym>XHTML</acronym> Document
	Structure</title>

      <programlisting><sgmltag class="starttag">html xmlns="http://www.w3.org/1999/xhtml"</sgmltag>
  <sgmltag class="starttag">head</sgmltag>
	  <sgmltag class="starttag">title</sgmltag><replaceable>The Document's Title</replaceable><sgmltag class="endtag">title</sgmltag>
  <sgmltag class="endtag">head</sgmltag>

  <sgmltag class="starttag">body</sgmltag>

    &hellip;

  <sgmltag class="endtag">body</sgmltag>
<sgmltag class="endtag">html</sgmltag></programlisting>
    </example>
  </sect1>

  <sect1 id="xhtml-markup-block-elements">
    <title>Block Elements</title>

    <sect2 id="xhtml-markup-block-elements-headings">
      <title>Headings</title>

      <para><acronym>XHTML</acronym> has tags to denote headings in
	the document at up to six different levels.</para>

      <para>The largest and most prominent heading is
	<sgmltag>h1</sgmltag>, then <sgmltag>h2</sgmltag>,
	continuing down to <sgmltag>h6</sgmltag>.</para>

      <para>The element's content is the text of the heading.</para>

      <example>
	<title><sgmltag>h1</sgmltag>, <sgmltag>h2</sgmltag>,
	  and Other Header Tags</title>

	<para>Usage:</para>

	<programlisting><sgmltag class="starttag">h1</sgmltag>First section<sgmltag class="endtag">h1</sgmltag>

&lt;!-- Document introduction goes here --&gt;

<sgmltag class="starttag">h2</sgmltag>This is the heading for the first section<sgmltag class="endtag">h2</sgmltag>

&lt;!-- Content for the first section goes here --&gt;

<sgmltag class="starttag">h3</sgmltag>This is the heading for the first sub-section<sgmltag class="endtag">h3</sgmltag>

&lt;!-- Content for the first sub-section goes here --&gt;

<sgmltag class="starttag">h2</sgmltag>This is the heading for the second section<sgmltag class="endtag">h2</sgmltag>

&lt;!-- Content for the second section goes here --&gt;</programlisting>
      </example>

      <para>Generally, an <acronym>XHTML</acronym> page should have
	one first level heading (<sgmltag>h1</sgmltag>).  This can
	contain many second level headings (<sgmltag>h2</sgmltag>),
	which can in turn contain many third level headings.  Do not
	leave gaps in the numbering.</para>
    </sect2>

    <sect2 id="xhtml-markup-block-elements-paragraphs">
      <title>Paragraphs</title>

      <para><acronym>XHTML</acronym> supports a single paragraph
	element, <sgmltag>p</sgmltag>.</para>

      <example>
	<title><sgmltag>p</sgmltag></title>

	<para>Usage:</para>

	<programlisting><sgmltag class="starttag">p</sgmltag>This is a paragraph.  It can contain just about any
  other element.<sgmltag class="endtag">p</sgmltag></programlisting>
      </example>
    </sect2>

    <sect2 id="xhtml-markup-block-elements-block-quotations">
      <title>Block Quotations</title>

      <para>A block quotation is an extended quotation from another
	document that will appear in a separate paragraph.</para>

      <example>
	<title><sgmltag>blockquote</sgmltag></title>

	<para>Usage:</para>

	<programlisting><sgmltag class="starttag">p</sgmltag>A small excerpt from the US Constitution:<sgmltag class="endtag">p</sgmltag>

<sgmltag class="starttag">blockquote</sgmltag>We the People of the United States, in Order to form
  a more perfect Union, establish Justice, insure domestic
  Tranquility, provide for the common defence, promote the general
  Welfare, and secure the Blessings of Liberty to ourselves and our
  Posterity, do ordain and establish this Constitution for the
  United States of America.<sgmltag class="endtag">blockquote</sgmltag></programlisting>
      </example>
    </sect2>

    <sect2 id="xhtml-markup-block-elements-lists">
      <title>Lists</title>

      <para><acronym>XHTML</acronym> can present the user with three
	types of lists: ordered, unordered, and definition.</para>

      <para>Entries in an ordered list will be numbered, while entries
	in an unordered list will be preceded by bullet points.
	Definition lists have two sections for each entry.  The first
	section is the term being defined, and the second section is
	the definition.</para>

      <para>Ordered lists are indicated by the <sgmltag>ol</sgmltag>
	element, unordered lists by the <sgmltag>ul</sgmltag>
	element, and definition lists by the <sgmltag>dl</sgmltag>
	element.</para>

      <para>Ordered and unordered lists contain listitems, indicated
	by the <sgmltag>li</sgmltag> element.  A listitem can
	contain textual content, or it may be further wrapped in one
	or more <sgmltag>p</sgmltag> elements.</para>

      <para>Definition lists contain definition terms
	(<sgmltag>dt</sgmltag>) and definition descriptions
	(<sgmltag>dd</sgmltag>).  A definition term can only contain
	inline elements.  A definition description can contain other
	block elements.</para>

      <example>
	<title><sgmltag>ul</sgmltag> and
	  <sgmltag>ol</sgmltag></title>

	<para>Usage:</para>

	<programlisting><sgmltag class="starttag">p</sgmltag>An unordered list.  Listitems will probably be
  preceded by bullets.<sgmltag class="endtag">p</sgmltag>

<sgmltag class="starttag">ul</sgmltag>
  <sgmltag class="starttag">li</sgmltag>First item<sgmltag class="endtag">li</sgmltag>

  <sgmltag class="starttag">li</sgmltag>Second item<sgmltag class="endtag">li</sgmltag>

  <sgmltag class="starttag">li</sgmltag>Third item<sgmltag class="endtag">li</sgmltag>
<sgmltag class="endtag">ul</sgmltag>

<sgmltag class="starttag">p</sgmltag>An ordered list, with list items consisting of multiple
  paragraphs.  Each item (note: not each paragraph) will be
  numbered.<sgmltag class="endtag">p</sgmltag>

<sgmltag class="starttag">ol</sgmltag>
  <sgmltag class="starttag">li</sgmltag><sgmltag class="starttag">p</sgmltag>This is the first item.  It only has one paragraph.<sgmltag class="endtag">p</sgmltag><sgmltag class="endtag">li</sgmltag>

  <sgmltag class="starttag">li</sgmltag><sgmltag class="starttag">p</sgmltag>This is the first paragraph of the second item.<sgmltag class="endtag">p</sgmltag>

    <sgmltag class="starttag">p</sgmltag>This is the second paragraph of the second item.<sgmltag class="endtag">p</sgmltag><sgmltag class="endtag">li</sgmltag>

  <sgmltag class="starttag">li</sgmltag><sgmltag class="starttag">p</sgmltag>This is the first and only paragraph of the third
    item.<sgmltag class="endtag">p</sgmltag><sgmltag class="endtag">li</sgmltag>
<sgmltag class="endtag">ol</sgmltag></programlisting>
      </example>

      <example>
	<title>Definition Lists with <sgmltag>dl</sgmltag></title>

	<para>Usage:</para>

	<programlisting><sgmltag class="starttag">dl</sgmltag>
  <sgmltag class="starttag">dt</sgmltag>Term 1<sgmltag class="endtag">dt</sgmltag>

  <sgmltag class="starttag">dd</sgmltag><sgmltag class="starttag">p</sgmltag>Paragraph 1 of definition 1.<sgmltag class="endtag">p</sgmltag>

    <sgmltag class="starttag">p</sgmltag>Paragraph 2 of definition 1.<sgmltag class="endtag">p</sgmltag><sgmltag class="endtag">dd</sgmltag>

  <sgmltag class="starttag">dt</sgmltag>Term 2<sgmltag class="endtag">dt</sgmltag>

  <sgmltag class="starttag">dd</sgmltag><sgmltag class="starttag">p</sgmltag>Paragraph 1 of definition 2.<sgmltag class="endtag">p</sgmltag><sgmltag class="endtag">dd</sgmltag>

  <sgmltag class="starttag">dt</sgmltag>Term 3<sgmltag class="endtag">dt</sgmltag>

  <sgmltag class="starttag">dd</sgmltag><sgmltag class="starttag">p</sgmltag>Paragraph 1 of definition 3.<sgmltag class="endtag">p</sgmltag><sgmltag class="endtag">dd</sgmltag>
<sgmltag class="endtag">dl</sgmltag></programlisting>
      </example>
    </sect2>

    <sect2 id="xhtml-markup-block-elements-preformatted-text">
      <title>Pre-formatted Text</title>

      <para>Pre-formatted text is shown to the user exactly as it is
	in the file.  Text is shown in a fixed font.  Multiple spaces
	and line breaks are shown exactly as they are in the
	file.</para>

      <para>Wrap pre-formatted text in the <sgmltag>pre</sgmltag>
	element.</para>

      <example>
	<title><sgmltag>pre</sgmltag></title>

	<para>For example, the <sgmltag>pre</sgmltag> tags could be
	  used to mark up an email message:</para>

	<programlisting><sgmltag class="starttag">pre</sgmltag>  From: nik@FreeBSD.org
  To: freebsd-doc@FreeBSD.org
  Subject: New documentation available

  There is a new copy of my primer for contributors to the FreeBSD
  Documentation Project available at

    &amp;lt;URL:http://people.FreeBSD.org/~nik/primer/index.html&amp;gt;

  Comments appreciated.

  N<sgmltag class="endtag">pre</sgmltag></programlisting>

	<para>Keep in mind that <literal>&lt;</literal> and
	  <literal>&amp;</literal> still are recognized as special
	  characters in pre-formatted text.  This is why the example
	  shown had to use <literal>&amp;lt;</literal> instead of
	  <literal>&lt;</literal>.  For consistency,
	  <literal>&amp;gt;</literal> was used in place of
	  <literal>&gt;</literal>, too.  Watch out for the special
	  characters that may appear in text copied from a plain-text
	  source, like an email message or program code.</para>
      </example>
    </sect2>

    <sect2 id="xhtml-markup-block-elements-tables">
      <title>Tables</title>

      <para>Mark up tabular information using the
	<sgmltag>table</sgmltag> element.  A table consists of one or
	more table rows (<sgmltag>tr</sgmltag>), each containing one
	or more cells of table data (<sgmltag>td</sgmltag>).  Each
	cell can contain other block elements, such as paragraphs or
	lists.  It can also contain another table (this nesting can
	repeat indefinitely).  If the cell only contains one paragraph
	then the <sgmltag>p</sgmltag>element is not needed.</para>

      <example>
	<title>Simple Use of <sgmltag>table</sgmltag></title>

	<para>Usage:</para>

	<programlisting><sgmltag class="starttag">p</sgmltag>This is a simple 2x2 table.<sgmltag class="endtag">p</sgmltag>

<sgmltag class="starttag">table</sgmltag>
  <sgmltag class="starttag">tr</sgmltag>
    <sgmltag class="starttag">td</sgmltag>Top left cell<sgmltag class="endtag">td</sgmltag>

    <sgmltag class="starttag">td</sgmltag>Top right cell<sgmltag class="endtag">td</sgmltag>
  <sgmltag class="endtag">tr</sgmltag>

  <sgmltag class="starttag">tr</sgmltag>
    <sgmltag class="starttag">td</sgmltag>Bottom left cell<sgmltag class="endtag">td</sgmltag>

    <sgmltag class="starttag">td</sgmltag>Bottom right cell<sgmltag class="endtag">td</sgmltag>
  <sgmltag class="endtag">tr</sgmltag>
<sgmltag class="endtag">table</sgmltag></programlisting>
      </example>

      <para>A cell can span multiple rows and columns by adding the
	<sgmltag class="attribute">rowspan</sgmltag> or
	<sgmltag class="attribute">colspan</sgmltag> attributes with
	values for the number of rows or columns to be spanned.</para>

      <example>
	<title>Using
	  <sgmltag class="attribute">rowspan</sgmltag></title>

	<para>Usage:</para>

	<programlisting><sgmltag class="starttag">p</sgmltag>One tall thin cell on the left, two short cells next to
  it on the right.<sgmltag class="endtag">p</sgmltag>

<sgmltag class="starttag">table</sgmltag>
  <sgmltag class="starttag">tr</sgmltag>
    <sgmltag class="starttag">td rowspan="2"</sgmltag>Long and thin<sgmltag class="endtag">td</sgmltag>
  <sgmltag class="endtag">tr</sgmltag>

  <sgmltag class="starttag">tr</sgmltag>
    <sgmltag class="starttag">td</sgmltag>Top cell<sgmltag class="endtag">td</sgmltag>

    <sgmltag class="starttag">td</sgmltag>Bottom cell<sgmltag class="endtag">td</sgmltag>
  <sgmltag class="endtag">tr</sgmltag>
<sgmltag class="endtag">table</sgmltag></programlisting>
      </example>

      <example>
	<title>Using
	  <sgmltag class="attribute">colspan</sgmltag></title>

	<para>Usage:</para>

	<programlisting><sgmltag class="starttag">p</sgmltag>One long cell on top, two short cells below it.<sgmltag class="endtag">p</sgmltag>

<sgmltag class="starttag">table</sgmltag>
  <sgmltag class="starttag">tr</sgmltag>
    <sgmltag class="starttag">td colspan="2"</sgmltag>Top cell<sgmltag class="endtag">td</sgmltag>
  <sgmltag class="endtag">tr</sgmltag>

  <sgmltag class="starttag">tr</sgmltag>
    <sgmltag class="starttag">td</sgmltag>Bottom left cell<sgmltag class="endtag">td</sgmltag>

    <sgmltag class="starttag">td</sgmltag>Bottom right cell<sgmltag class="endtag">td</sgmltag>
  <sgmltag class="endtag">tr</sgmltag>
<sgmltag class="endtag">table</sgmltag></programlisting>
      </example>

      <example>
	<title>Using <sgmltag class="attribute">rowspan</sgmltag> and
	  <sgmltag class="attribute">colspan</sgmltag>
	  Together</title>

	<para>Usage:</para>

	<programlisting><sgmltag class="starttag">p</sgmltag>On a 3x3 grid, the top left block is a 2x2 set of
  cells merged into one.  The other cells are normal.<sgmltag class="endtag">p</sgmltag>

<sgmltag class="starttag">table</sgmltag>
  <sgmltag class="starttag">tr</sgmltag>
    <sgmltag class="starttag">td colspan="2" rowspan="2"</sgmltag>Top left large cell<sgmltag class="endtag">td</sgmltag>

    <sgmltag class="starttag">td</sgmltag>Top right cell<sgmltag class="endtag">td</sgmltag>
  <sgmltag class="endtag">tr</sgmltag>

  <sgmltag class="starttag">tr</sgmltag>
    &lt;!-- Because the large cell on the left merges into
         this row, the first &lt;td&gt; will occur on its
         right --&gt;

    <sgmltag class="starttag">td</sgmltag>Middle right cell<sgmltag class="endtag">td</sgmltag>
  <sgmltag class="endtag">tr</sgmltag>

  <sgmltag class="starttag">tr</sgmltag>
    <sgmltag class="starttag">td</sgmltag>Bottom left cell<sgmltag class="endtag">td</sgmltag>

    <sgmltag class="starttag">td</sgmltag>Bottom middle cell<sgmltag class="endtag">td</sgmltag>

    <sgmltag class="starttag">td</sgmltag>Bottom right cell<sgmltag class="endtag">td</sgmltag>
  <sgmltag class="endtag">tr</sgmltag>
<sgmltag class="endtag">table</sgmltag></programlisting>
      </example>
    </sect2>
  </sect1>

  <sect1 id="xhtml-markup-inline-elements">
    <title>In-line Elements</title>

    <sect2 id="xhtml-markup-inline-elements-emphasizing-information">
      <title>Emphasizing Information</title>

      <para>Two levels of emphasis are available in
	<acronym>XHTML</acronym>, <sgmltag>em</sgmltag> and
	<sgmltag>strong</sgmltag>.  <sgmltag>em</sgmltag> is for a
	normal level of emphasis and <sgmltag>strong</sgmltag>
	indicates stronger emphasis.</para>

      <para><sgmltag>em</sgmltag> is typically rendered in italic
	and <sgmltag>strong</sgmltag> is rendered in bold.  This is
	not always the case, and should not be relied upon.  According
	to best practices, web pages only hold structural and
	semantical information, and stylesheets are later applied to
	them.  Think of semantics, not formatting, when using these
	tags.</para>

      <example>
	<title><sgmltag>em</sgmltag> and
	  <sgmltag>strong</sgmltag></title>

	<para>Usage:</para>

	<programlisting><sgmltag class="starttag">p</sgmltag><sgmltag class="starttag">em</sgmltag>This<sgmltag class="endtag">em</sgmltag> has been emphasized, while
  <sgmltag class="starttag">strong</sgmltag>this<sgmltag class="endtag">strong</sgmltag> has been strongly emphasized.<sgmltag class="endtag">p</sgmltag></programlisting>
      </example>
    </sect2>

    <sect2 id="xhtml-markup-inline-elements-fixed-pitch-text">
      <title>Indicating Fixed-Pitch Text</title>

      <para>Content that should be rendered in a fixed pitch
	(typewriter) typeface is tagged with <sgmltag>tt</sgmltag>
	(for <quote>teletype</quote>).</para>

      <example>
	<title><sgmltag>tt</sgmltag></title>

	<para>Usage:</para>

	<programlisting><sgmltag class="starttag">p</sgmltag>Many system settings are stored in
  <sgmltag class="starttag">tt</sgmltag>/etc<sgmltag class="endtag">tt</sgmltag>.<sgmltag class="endtag">p</sgmltag></programlisting>
      </example>
    </sect2>

    <sect2 id="xhtml-markup-inline-elements-links">
      <title>Links</title>

      <note>
	<para>Links are also inline elements.</para>
      </note>

      <sect3 id="xhtml-markup-inline-elements-linking">
	<title>Linking to Other Documents on the Web</title>

	<para>A link points to the <acronym>URL</acronym> of a
	  document on the web.  The link is indicated with
	  <sgmltag>a</sgmltag>, and the
	  <sgmltag class="attribute">href</sgmltag> attribute contains
	  the <acronym>URL</acronym> of the target document.  The
	  content of the element becomes the link, indicated to the
	  user by showing it in a different color or with an
	  underline.</para>

	<example>
	  <title>Using
	    <sgmltag class="starttag">a href="..."</sgmltag></title>

	  <para>Usage:</para>

	  <programlisting><sgmltag class="starttag">p</sgmltag>More information is available at the
  <sgmltag class="starttag">a href="http://www.&amp;os;.org/"</sgmltag>&amp;os; web site<sgmltag class="endtag">a</sgmltag>.<sgmltag class="endtag">p</sgmltag></programlisting>
	</example>

	<para>This link always takes the user to the top of the linked
	  document.</para>
      </sect3>

      <sect3 id="xhtml-markup-inline-elements-specific-parts">
	<title>Linking to Specific Parts of Documents</title>

	<para>To link to a specific point within a document, that
	  document must include an <emphasis>anchor</emphasis> at the
	  desired point.  Anchors are included by setting the
	  <sgmltag class="attribute">id</sgmltag> attribute of an
	  element to a name.  This example creates an anchor by
	  setting the <sgmltag class="attribute">id</sgmltag>
	  attribute of a <sgmltag class="element">p</sgmltag>
	  element.</para>

	<example>
	  <title>Creating an Anchor</title>

	  <para>Usage:</para>

	  <programlisting><sgmltag class="starttag">p id="samplepara"</sgmltag>This paragraph can be referenced
  in other links with the name <sgmltag class="starttag">tt</sgmltag>samplepara<sgmltag class="endtag">tt</sgmltag>.<sgmltag class="endtag">p</sgmltag></programlisting>
	</example>

	<para>Links to anchors are similar to plain links, but include
	  a <literal>#</literal> symbol and the anchor's
	  <acronym>ID</acronym> at the end of the
	  <acronym>URL</acronym>.</para>

	<example>
	  <title>Linking to a Named Part of a Different
	    Document</title>

	  <para>The <literal>samplepara</literal> example is part of a
	    document called <filename>foo.html</filename>.  A link to
	    that specific paragraph in the document is constructed in
	    this example.</para>

	  <programlisting><sgmltag class="starttag">p</sgmltag>More information can be found in the
  <sgmltag class="starttag">a href="foo.html#samplepara"</sgmltag>sample paragraph<sgmltag class="endtag">a</sgmltag> of
  <sgmltag class="starttag">tt</sgmltag>foo.html<sgmltag class="endtag">tt</sgmltag>.<sgmltag class="endtag">p</sgmltag></programlisting>
	</example>

	<para>To link to a named anchor within the same document, omit
	  the document's <acronym>URL</acronym>, and just use the
	  <literal>#</literal> symbol followed by the name of the
	  anchor.</para>

	<example>
	  <title>Linking to a Named Part of the Same Document</title>

	  <para>The <literal>samplepara</literal> example
	    resides in this document.  To link to it:</para>

	  <programlisting><sgmltag class="starttag">p</sgmltag>More information can be found in the
  <sgmltag class="starttag">a href="#samplepara"</sgmltag>sample paragraph<sgmltag class="endtag">a</sgmltag> of this
  document.<sgmltag class="endtag">p</sgmltag></programlisting>
	</example>
      </sect3>
    </sect2>
  </sect1>
</chapter>