Professional Documents
Culture Documents
HTML
Thomas A. Powell
http://www.tup.tsinghua.edu.cn
01-2001-3285
HTML HTML XHTML
HTML HTML HTML
XML
HTML
Web
JavaScript HTML
HTML
McGraw-Hill
HTML
Thomas A. Powell
100084
7871092 1/16
58.125
2002 3 1
00014000
ISBN 7-302-05290-5/TP3110
96.00
1414
2002 3 1
Thomas A. Powell Internet UCLA PICnet
CERFnet CERFnet Internet
1994 Internet PINTwww.pint.com
California San Diego
Powell
The Complete Reference, Web Site Engineering, HTML Programmers
Reference Network World, IT World, NetGuide, Internet Week Interactive Age
XHTML University of
California, San Diego
PINT (www.pint.com )
PINT HTML Dan Whitworth
Fritz Schneider
HTML
PINT Rob McFarlaneAnh
Tran Jason Zimmerman PINT Maria Defante
Eric RaetherJimmy TamDavid SnowMeredith HodgeCathleen RyanCory DuckerReuben
PoonKim SmithPatrick FischerPeter LarsonVergil PascualMatt PlotnerMichele Bedard
Nigel Paxton Kate
GranthamDaisy Bhonsle
Sylvia Diana
Thomas A. Powell
tpowell@pint.com
2000 11
1
1 HTML XHTML ..............1
1.1
HTML ............................................ 1
1.1.1
HTML.............. 5
1.2
................................................ 6
1.3
<html>............................................. 9
1.4
<head> ............................................ 9
1.4.1
<title> ...................................... 9
1.4.2
head .......... 11
2.3
...........................................24
2.3.1
...........25
2.3.2
...................................26
2.4
Audience................................26
2.4.1
User Profiling.........27
2.5
.......................................................27
2.6
...............................................28
2.7
.......................................30
2.7.1
.......................................30
................................... 12
2.7.2
...........................31
HTML .......................................... 12
2.7.3
...............................33
2.7.4
HTML...................................34
2.7.5
HTML ...................37
1.5
<body> .......................................... 11
1.6
1.7
1.7.1 XHTML:................ 16
1.7.2
1.8
2.8
Beta ..................................41
1.9
...................................................... 21
2.9
.......................................................41
2.9.1
...........................43
2 Web .........................22
2.10
.................................43
2.1
Web ................. 22
2.11
.............................43
2.2
Web ............................. 23
2.12
.....................................................44
HTML
3 ..................................45
3.1.6
.......................................47
HTML .................................. 45
3.2
.......................................................47
3.1.1
id ........................................... 45
3.3
...........................................49
3.1.2
class ...................................... 46
3.4
<div><center> ...................52
3.1.3
style ...................................... 46
3.1.4
title ........................................ 46
3.5
...................................................53
3.1.5
............................... 47
3.6
.......................................55
3.1
3.4.1
Spans .............................................53
3.7
...................................................... 56
4.3.2
...................................92
3.7.1
....................................... 57
3.7.2
....................................... 59
4.4.1
name ...........................94
3.7.3
....................................... 61
4.4.2
Title .............................95
3.7.4
................... 62
4.4.3
...........................................96
3.8
.......................................... 63
4.4.4
tabindex ................................97
3.9
....................................... 64
...............................................93
4.4.5
target .....................................97
<address> ...................................... 64
4.4.6
...........................98
................................. 65
4.4.7
...............................98
3.9.1
3.10
4.4
3.10.1
............. 65
4.5
...............................................99
3.10.2
..................................... 67
4.6
.........................................100
3.11
............................. 69
4.6.1
.............101
3.12
............................................ 70
4.6.2
.................102
3.13
.................................................... 72
4.6.3
.....................105
3.14
.................................................... 73
4 ..............................74
4.1
.............................................. 74
4.2
URL ......................................... 76
4.7
<link> ..............109
4.7.1
.........................109
4.7.2
4.7.3
4.8
............................................. 112
4.2.1
....................................... 77
4.8.1
4.2.2
URL ...................................... 83
4.8.2
4.2.3
URL.................................. 89
4.8.3
4.3
HTML ......................... 90
4.3.1
4.9
..................................................... 115
Anchor....................... 90
5 HTML ........................116
5.2.3
............................................ 116
5.2.4
<br> .........................128
5.1.1
5.2.5
.................................130
5.1.2
5.2.6
.....................131
5.1
5.3
.................................132
............................. 121
5.4
.........................................133
5.1.4
5.4.1
.................134
5.2.1
5.4.2
.....................134
5.2.2
............................. 124
5.4.3
5.2
<object>...................................135
5.5
..................................... 135
3
7.2 Microsoft ...................................183
5.5.1
..................................... 135
7.3
.........183
5.5.2
......................... 136
7.4
.....................................................187
5.5.3
......................... 136
5.6
.................................................... 138
6
..............................................139
8 .......................................188
8.1
.....................................................188
8.1.1
.....................................189
8.1.2
.........................189
6.1
............................................ 139
8.1.3
<noframes>......................191
6.2
8.1.4
.....................................192
6.2.1
6.2.2
Non-Breaking Spaces
8.2.1
floating frame.......198
..................................................... 141
8.2.2
.....................................200
6.2.3
<center>............................... 143
8.2.3
.........................200
6.2.4
6.2.5
6.2.6
..................................... 144
6.2.7
................. 145
6.2.8
9.1.1
.............................202
9.1.2
.............203
.................................................... 149
9.1.3
.........................203
6.3.1
................. 154
9.1.4
MP3 .............................................204
6.3.2
................................. 154
9.1.5
.............................204
6.3.3
9.1.6
RealAudio....................................205
6.3.4
9.1.7
WindowsMedia ..................208
6.2.9
6.3
8.2
8.3
.............................................195
.....................................................201
9 HTML .....................202
9.1
9.2
.....................................................202
.....................................................209
6.4
6.5
9.2.1
.............................210
6.6
............................................ 160
9.2.2
QuickTime ...................................212
9.2.3
.............................215
6.6.1
6.7
..................................... 162
6.8
.................................................... 163
7 .....................164
7.1
............................................ 164
9.3
.....................................................216
9.3.1
<marquee> .......216
9.3.2
GIF .....................................218
9.3.3
Flash ............................................218
7.1.1
................................. 164
7.1.2
7.1.3
............. 169
7.1.4
............................. 180
10.1
.......................................223
7.1.5
10.2
...............................225
9.5
.....................................................221
10 .................................223
10.2.1
....................... 225
10.2.2
....... 226
10.2.3
........................... 229
10.10.1
1color.......................................254
10.10.2
background-color.....................254
10.10.3
background-image ...................254
................................... 230
10.10.4
background-repeat ...................254
10.10.5
background-attachment............255
10.4.2
10.10.6
background-position ................255
10.4.3
........................... 232
10.10.7
background ..............................256
10.4.4
................................... 234
10.4.5
....................................... 234
10.11.1
margin ............................258
10.5
........................... 236
10.11.2
border .............................260
10.6
10.11.3
padding ..........................263
10.11.4
10.11.5
10.3
10.3.1
10.4
10.6.1
10.7
10.11
Box .........................................257
10.7.1
font-family................................. 240
10.12
Display ...................................267
10.7.2
font-size..................................... 241
10.13
.............................267
10.7.3
10.13.1
.............................268
10.7.4
10.13.2
z-index.....................................271
10.7.5
font-variant................................ 242
10.7.6
10.14.1
CSS2 ...............274
10.14.2
CSS2 .......275
10.14.3
10.8
10.14
CSS2 ..............................274
................................................276
10.14.4
CSS2 ...............276
10.14.5
display .................277
10.8.5
10.8.3
vertical-align.............................. 246
10.14.6
.................................277
10.14.7
CSS .............279
10.14.8
.....................279
10.14.9
CSS2 ......282
10.8.9
10.9
white-space................................ 247
10.15
CSS3 ...................285
10.16 Microsoft
.........................................................286
10.17
.................................287
10.18
.................................................288
11.1
................................... 289
11.2
........................................... 290
11.3
11.3.1
11.3.2
11.3.3
11.4
....................... 295
....................................... 295
11.4.1
................................... 295
11.4.2
................................... 299
11.4.3
11.4.4
................................... 301
11.4.5
....................................... 302
11.4.6
................................... 303
11.4.7
............... 304
11.4.8
11.5
HTML
11 HTML
............................................289
11.3.5
................................... 309
11.5.1
11.5.2
<label>....................................... 310
11.5.3
<fieldset>................................... 310
11.5.4
............... 312
11.5.5
HTML 4.0
.................................................. 313
12 ........324
12.1
/
..........................................................324
12.2
...................................326
12.3
(CGI) .........................327
12.3.1
CGI ..................................329
12.3.2 CGI
...................................................330
12.3.3 CGI
...................................................334
12.3.4
CGI ..........................336
12.3.5
CGI ..........337
12.4
NSAPI, ISAPI
...........................................................337
12.5
.......................338
12.5.1
12.6
SSI .............339
ColdFusion ........................................342
12.6.1
CFML ...............................343
12.6.2
CFML ...............................349
12.7
(ASP).....................350
12.7.1
12.8
ASP ..........................350
...................................................354
13 JavaScript DHTML
............................................355
11.5.6
................................... 313
13.1
...............................355
11.5.7
................... 315
13.2
JavaScript ..........................................356
11.5.8
CSS............................... 316
13.3 VBScript............................................357
11.6
WebTV
.......................................................... 319
13.4.1
<script>..............................359
11.7
Internet Explorer
13.4.2
<noscript>..................................361
........................................................... 320
13.4.3
...............................362
11.8
....................................... 321
11.9
................................................... 323
13.4
13.5
HTML ..............358
HTML...........................362
13.5.2
13.6
13.7
13.7.1
................................... 370
13.8
13.9
13.10
............. 376
13.11
......................................... 379
13.11.1
..................... 379
13.11.2
......................... 380
13.11.3
......................... 380
13.11.4
................................. 382
13.11.5
................................. 384
13.12
................................................ 385
14 ActiveX
Java ...............................386
14.1
...........386
14.2
...................................................386
14.2.1
14.3
ActiveX ....................................393
14.3.1
14.4
<embed>............................388
...................394
Java ...............................398
14.4.1
<applet>.............................400
14.4.2
Java ...402
14.4.3
Java .......404
14.5
.......404
14.6
...................................................405
15 ..............................407
16.1.2
<meta> http-equiv...............430
15.1
........................... 407
16.1.3
...................................430
15.2
................................... 408
16.1.4
...............................431
15.3
................................... 409
16.1.5
PICS .........431
15.3.1
................................... 410
16.2
...............................434
15.3.2
................................... 410
16.3
...........................435
............................... 411
16.3.1
.......................436
15.4.1
....................... 412
16.3.2
...............................436
15.4.2
....................... 414
16.3.3
Robots.txt ..................................437
16.3.4
<meta> ...........438
15.4
15.5
15.5.1
HTTP......................................... 417
16.4
.......................438
16.4.1
<meta> ...438
15.6
................... 428
16.4.2
.......................439
15.7
.................................................. 428
16.4.3
.......................440
16.4.4
...........................441
16.4.5
...............................441
16 ..............................429
16.1
.............................................. 429
16.5
...........................................442
16.5.1
...............................442
16.6
.......................................... 443
16.7
.......................................... 444
16.8
HTMLSGML XML
17.9
17.3
................................... 451
XML......................................... 454
17.3.1
17.3.2
17.7
SMIL................................................. 467
17.8
7
A HTML .....................481
A.1
A.1.1
A.1.2
XHTML.................. 483
A.2
.................................... 484
A.2.1
class............................................ 484
A.2.2
id ................................................ 484
A.2.3
A.2.4
A.3
........................................... 485
A.3.1
A.3.2
...........................................472
18.2
...................................474
18.3
...............................475
18.4
Web-Wide ........................476
18.4.1
.......................476
18.4.2
Accessibility
18.4.3
18.1
Usability.............477
17.6
...................................................471
18 ..........................472
........................................................... 447
17.2.1
...................................................446
...........................477
18.6
HTML ..................................479
18.7
...................................................480
A.4
........................................... 486
A.4.1
A.5
................................... 488
A.5.1
A.5.2
<!DOCTYPE>
................................................... 495
A.5.3
A.5.4
<abbr>Abbreviation
................................................... 500
A.5.5
<acronym>Acronym
................................................... 501
A.5.6
12
A.5.7
<applet>Java
A.5.30
.................................................... 505
A.5.8
List 548
A.5.31
................... 509
A.5.9
<audioscope>
<b>Bold................ 513
A.5.11
A.5.12
A.5.32
A.5.33
................................................. 515
A.5.34
<basefont>Base Font
A.5.35
<dl>Definition List
<bdo>Bidirectional Override
................................................. 559
A.5.36
.......... 562
A.5.37
.............................. 519
A.5.38
<embed>Embedded Object
A.5.16
<blackface>Blackface Font
............................. 566
A.5.39
.................................. 522
A.5.18
A.5.19
A.5.20
<blink>Blinking TextDisplay
A.5.40
<fn>Footnote........ 571
...................... 523
A.5.41
<font>Font Definition
..................................... 572
<blockquote>Block Quote
.......................... 524
A.5.42
<form>Form......... 575
<body>Document Body
A.5.43
<frame>.................... 578
.................................................. 526
A.5.44
<frameset>........ 580
<bq>Block Quote
A.5.45
<h1><h6>
..................................... 584
.................................................. 529
A.5.21
A.5.22
A.5.23
<caption>
A.5.46
<center>Center Alignment
<head>Document Head
................................................. 586
A.5.47
.................................................. 534
A.5.24
<bgsound>Background Sound
A.5.15
A.5.17
<dir>Directory List
................................................. 554
.............................. 518
A.5.14
<dfn>Defining Instance of a
Term .............. 552
................................................. 516
A.5.13
<del>Deleted Text
.................................. 550
.................................................... 512
A.5.10
<dd>Definition in a Definition
<hr>Horizontal Rule
................................................. 587
A.5.48
.............................. 537
<HTML>HTML Document
HTML ......................... 590
A.5.25
<cite>Citation....... 539
A.5.49
<i>Italic................ 591
A.5.26
<code>.............. 541
A.5.50
<iframe>Floating Frame
A.5.27
<col>Column............ 542
A.5.28
<colgroup>Column Group
A.5.51
.................................................. 545
A.5.52
<comment>Comment Information:
A.5.53
A.5.29
.............................. 547
...................................... 593
...................... 602
A.5.54
<ins>Inserted Text
11
A.5.74
................................. 650
.................................................. 607
A.5.55
<isindex>Index Prompt
A.5.75
...................................... 609
A.5.56
A.5.57
<optgroup>Option Grouping
<option>Option in Selection List
..................... 652
<kbd>Keyboard Input
A.5.76
...................................... 611
A.5.77
<param>Object Parameter
A.5.78
<plaintext>Plain Text
..................................... 656
A.5.58
A.5.59
A.5.60
A.5.61
<link>
A.5.80
<q>Quote.......... 662
.............................. 623
A.5.81
<rt>Ruby Text
A.5.62
................................................. 658
A.5.79
<pre>Preformatted Text
..................... 660
<listing>Code Listing
................................................. 664
.................................................. 626
A.5.82
<ruby>...................................... 666
A.5.63
A.5.83
<s>Strikethrough
A.5.64
<marquee>Marquee Display
A.5.84
<samp>Sample Text
...................... 628
............................... 668
...................... 629
A.5.65
............................................... 670
<menu>Menu List
A.5.85
................................................. 633
A.5.86
<select>Selection List
A.5.66
<meta>.................. 635
A.5.67
<multicol>Multiple Column
................................... 675
A.5.87
Text................... 637
A.5.68
<nobr>No Breaks
............................................... 678
A.5.88
................................................. 638
A.5.69
A.5.89
Support
A.5.90
<strike>Strikeout text
............................... 684
A.5.91
Content
................................................. 640
A.5.71
<spacer>Extra Space
............................................... 680
................................................. 639
A.5.70
<small>Small Text
............................................... 685
A.5.92
A.5.93
................................................. 642
A.5.72
<object>Embedded Object
A.5.73
<ol>Ordered List
<sub>Subscript
............................................... 689
A.5.94
<sup>Superscript
A.5.95
<table>...................... 693
..................................... 643
................................................. 647
<style>Style Information
................................... 688
<strong>Strong Emphasis
............................................... 691
12
A.5.96
<tbody>Table Body
............................................... 698
A.5.97
<td>Table Data
A.5.98
A.5.100
A.5.101
A.5.103
A.5.104
A.5.105
A.5.106
A.5.107
A.5.108
B.2
............................................ 742
................................................... 742
a:active ....................................... 742
................................... 701
B.2.2
a:link........................................... 743
B.2.3
B.3
............................................... 743
<tfoot>Table Footer
B.3.1
first-letter.................................... 743
............................................... 710
B.3.2
first-line...................................... 744
<th>Table Header
B.4
................................................... 744
................................... 713
<thead>Table Header
B.4.2
............................... 717
A.5.102
B.1.8
B.2.1
................ 706
A.5.99
B.5
!important................................... 744
................................................... 745
<title>Document Title
B.5.1
font-family.................................. 745
................................... 720
B.5.2
font-size...................................... 747
<tr>Table Row
B.5.3
............................................... 721
B.5.4
<tt>Teletype Text
B.5.5
font-variant................................. 753
............................................... 724
<u>Underline
............................................... 726
B.5.8
<ul>Unordered List
B.6
............................................... 728
B.6.1
<var>Variable
............................................... 731
<wbr>Word Break
............................................... 732
B.6.5
A.5.109
A.5.110
<xmp>Example
............................................... 735
B ............................738
....................................... 762
B.7.1
........................................ 738
B.1.1
................................ 738
B.1.2
................................ 739
B.1.3
................................ 739
B.1.4
................................ 739
B.1.5
B.8.1
B.1.6
............................................ 741
B.1.7
............................................ 742
B.1
B.8
........................................... 774
margin ........................................ 774
B.8.4
width........................................... 784
11
B.12.11
line-break................................ 806
B.8.6
float............................................. 785
B.8.7
B.12.14
.................................................... 787
B.12.15
B.12.16
B.9.2
B.9
B.12.17
scrollbar-3d-light-color........... 807
B.12.18
B.12.19
B.12.20
scrollbar-dark-shadow-color... 808
B.12.21
scrollbar-face-color................. 808
B.12.22
B.10.1
B.12.23
B.10.2
B.10.3
B.10.4
.................................. 795
B.10.5
B.10.6
B.12.28
word-break.............................. 809
B.10.7
B.12.29
B.12.30
B.12.31
zoom....................................... 810
B.10
B.11
B.11.1
B.11.2
B.11.3
B.13.1
% .............................................. 810
B.11.4
B.13.2
cm............................................. 811
B.11.5
overflow.................................... 800
B.13.3
em............................................. 811
B.11.6
B.13.4
B.11.7
B.13.5
in............................................... 811
B.11.8
B.13.6
mm............................................ 812
B.13.7
pc.............................................. 812
B.13
.......................... 810
B.12.1
background-position-x.............. 804
B.13.8
pt............................................... 812
B.12.2
background-position-y.............. 804
B.13.9
px.............................................. 812
B.12.3
B.12.4
B.14.1
B.12.5
ime-mode.................................. 805
B.12.6
B.12.7
B.14.4
B.12.8
B.14.5
RGB
B.12.9
B.14
.................................. 813
.......... 813
................................................. 814
12
C ................................815
C.1
C.2
E ............................... 861
C.2.1
A ........................ 848
C.2.2
B ........................ 848
C.2.3
............................ 848
C.2.4
............................ 849
C.2.5
.................................... 850
C.2.6
........................ 853
F.1
.................................... 869
C.2.7
............................................ 854
F.2
........................................ 870
C.2.8
................................ 854
F.3
........................................ 870
C.2.9
.................................... 856
F.4
.................................... 871
C.2.10
.................................. 856
F.5
.................................... 871
C.2.11
.................................. 856
F.6
............................................ 872
D .......................................857
F.7
F.8
............................................ 873
F.9
............................................ 873
D.1
Microsoft
............................................................ 857
D.2
D.3
D.4
D.5
E.1
.................................... 861
E.2
............ 863
F DTDDocument Type
Definition ........................... 869
F.10
.................................................. 874
F.11
.............................. 874
F.12
F.13
F.14
1
1
HTML XHTML
HTML Web
Web
1.1
HTML
HTML Web
<b></b>
<b>This is important text</b>
HTML HTML
1-1
HTML
Web
HTML
HTML Web
<b></b>
/
HTML
HTML
HTML
<br>
1-1
HTML Web
HTML
noshade hr
<hr noshade>
img HTML
HTML
HTML
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>First HTML Example</title>
</head>
<body>
<h1>Welcome to the World of HTML</h1>
<hr>
1 HTML XHTML
HTML
<!DOCTYPE> HTML
<html></html><head></head><body></body>
<title></title> Web
<h1></h1>
<hr>
<p></p>
firstexample.htmfirstexample.html
.htm .html
HTML
1-2
1-2
HTML
1-3
HTML Web
ReloadRefresh
ReloadRefresh
Shift
HTML
Web
HTML
2
HTML <b>
HTML Web
Microsoft Word
Web
Web
Web Design: The Complete Reference
ISBN 007212297-8
HTML
1 HTML XHTML
1.1.1 HTML
HTML
HTML
W3C
The World
Wide Web Consortium HTML Web
W3C
HTML HTML W3C HTML
SGMLStandard Generalized Markup Language
SGML DTDdocument type definition
HTML
<!DOCTYPE> HTML
<html>Head Body
<head></head> Head
title<body></body> body
HTML <frameset><body><frameset>
<frame><frame>
8 <!DOCTYPE>
<html><head><body>
1.2
2
HTML DTD HTML
<!DOCTYPE> HTML 4.0
HTML 4.01
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
HTML XHTML
<!DOCTYPE>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
HTML 1-1
1 HTML XHTML
1-1
HTML DOCTYPE
HTML
<!DOCTYPE>
2.0
3.2
4.0 Transitional
4.0 Frameset
4.0 Strict
4.01 Transitional
4.01 Frameset
4.01 Strict
XHTML HTML Web HTML
HTML 1-2
HTML
1-2
HTML
HTML
2.0
3.0
HTML 2.0
3.2
4.0 Transitional
4.0 Strict
4.0 Frameset
frameset
HTML
HTML
4.01 Transitional/Strict/
4.0
Frameset
HTML
HTML
HTML
1-3 HTML
1-3
Netscape 2.x
JavaJavaScriptFrame Plug-in
2.0 Netscape
3.2
Netscape 3.x
<spacer><multicol>
3.2 Netscape
Netscape 4.x
Netscape 6.x
CSS HTML
<layer>
Netscape
JscriptActiveX
3.2 Microsoft
VBScript HTML
CSS1
<marquee><bgsound>
Internet Explorer 4.0
JavaScript
4.0
Microsoft CSS1
XML DOM
4.0 Microsoft
CSS1 DOM
WebTV
3.2 WebTV
Netscape Microsoft
<!DOCTYPE> HTML
W3C
HTML
1 HTML XHTML
XHTML
1.3
<html>
1.4
<head>
HTML head
HTML head <head>
<head></head> HTML
Web
<head>
1.4.1 <title>
head <title>
HTML
<head><head></head> HTML
<title> HTML
©
HTML <title>
<title>
<title><b>Home Page</b></title>
10
Web
<title>
anthe
1-4
1 HTML XHTML
11
1.4.2 head
HTML 4.01 DTD <title><head><base>
<isindex><link><meta><object><script><style>
head
<base> URL URL
URL 4
<isindex>
<meta>/name/value<meta>
<meta> http HTTP
request header 16
<meta>
<object> Web
Java ActiveX
Web 14 <object>
<script> Web
ECMAScript JavaScript<script>
HTMLDHTMLDynamic HTML
14
<style>
10 <style>
1.5
<body>
12
XHTML <body>
<body>
6
HTML body
1.6
body
<p><h1>
<b><strong>
<img><object>
<marquee> 3
body
HTML >
escaped
&code; code
<
< < 3
C
1.7
HTML
HTML
XHTML HTML
HTML
HTML
HTML
<B>Go
<B>Go
<b>Go
<b>Go
boldly</B>
boldly</b>
boldly</B>
boldly</b>
1 HTML XHTML
13
HTML
XHTML
HTML
HTML
XHTML
HTML HTML
<img SRC =
" test.gif "><img src = " test.gif "><img> SRC
URL <img src =
" test.gif "><img src =" TEST.GIF "> UNIX
test.gif TEST.GIF NT
HTML
HTML
Tab
<b>T e s t o f s p a c e s</b><br>
<b>T e s
t o f
s p a c e s </b><br>
<b>T
e s
t o f s p
a c e s</b><BR>
Tab
HTML <pre>
<textarea>
14
HTML HTML
HTML 2
HTML <img>
<a>
<a href="http://www.democompany.com">
<img src="democompany.gif" width="221" height="64"
border="0" alt="Demo Company">
</a>
<img></a>
HTML
HTML
 
Look, Im spaced!
Web
HTML
HTML Content Model
<ul>
<p>Its simple to break the content model!</p>
</ul>
HTML <ul>
<li><p>
<input><form> <option> <select>
HTML
1 HTML XHTML
15
HTML
HTML 2
<hr><br>
<p><p><p>
<p>
HTML
<p> </p><p> </p><p> </p>
HTML <br>
HTML
HTML HTML
HTML
<b><i>is not since tags nest</i></b>.
XHTML
HTML
src
JavaScript src src
bozo 2.gifXHTML
JavaScript
HTML
16
<bogus>
obviouslybad
HTML
HTML
XHTML Web
1.7.1 XHTML:
HTML XHTML W3C 2000 1 XHTML XML
HTML HTML
XHTML
<title> <head>
<p align=left>
<i><b>is ok</b></i>, <i><b> is not </i></b>
<p><p></p>
<hr />
HTML
XHTML HTML
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
1 HTML XHTML
17
XHTML
XHTML
XHTML Web
XHTML HTML
Web
XHTML
Web 99%
HTML HTML
Microsoft FrontPage
HTML HTML
<table> HTML
HTML
HTML
18
HTML
HTML
HTML
HTML <strong>
<strong>This is important.</strong>
<h1> <h6><p>
Web
<bold>
<strong><strong>
Web
<date>
10 HTML
HTML HTML HTML
HTML
<cite>
<h1> Internet
Web Web
HTML bug
XHTML XHTML
<table><frame>
HTML
HTML HTML 4XHTML CSS
1 HTML XHTML
19
Web
1.8
HTML XHTML
HTML HTML
1HTML
HTML PostScript
HTML HTML
CSSCascading Style Sheet
HTML HTML
HTML
2HTML
HTML HTML
JavaScript
HTMLDHTML Web
DHTML
HTML
13
HTML
3HTML
HTML
HTML
XML HTML HTML XML
HTML
HTML W3C
HTML http://www.w3.org/MarkUp
/Activity.html
20
4HTML
W3C HTML
W3C HTML
Web
5 HTML
HTML Web
Web HTML
Web
6XHTML Web
HTML
Web XHTML
XHTML Web
HTML
HTML
HTMLHTML
Web
7HTML
Web
HTML
HTML
8HTML Web
HTML Web Web
HTML Web
HTML HTML
Web
1 HTML XHTML
1.9
21
HTML
Web
HTML
HTML HTML Web
XML
HTML HTML
PostScript
HTML
Web
HTML Web
HTML Web
Web Web
HTML
HTML Web
HTML Web Design: The Complete Reference
ISBN 007212297-8 HTML
2.1
Web
Web 20 60
brochureware
Web
Web
HTML
2 Web
23
Web
Web
2.2
Web
Process Model
Web
Web
2-1
24
2-1
Web Web
Web
,
Web
2.3
Web
Web
2 Web
25
Goal
Statement
25%
10000
3 2 25%10000
300
2.3.1
Web
26
2.3.2
wish
list
35
2.4 Audience
Internet
2 Web
27
User Profile 3 3
Internet
Visit Scenarios
Bob Beginner
2.5
Web
visualdelivery
28
Web 3
2.6
2-1
2.1
Butler Robot
Microsoft Word
Jennifer Tuggle
John P. Lawyer
GIF
Pascal Wirth
Microsoft Word
Butler 7
Robot Personality
Demo Cray-9000
HTML
JavaScriptCGIColdFusionJava
2 Web
29
2-2
2-2
Web
man-hour
Web
30
2.7
Web
Web
2.7.1
2-3
2-3
2 Web
31
Web
2.7.2
Web
HTML
2-4
2-4
Demo Company
32
HTML
2-5 Demo Company GIF
2-5
Demo Company
2-6
2-6
Demo Company
2 Web
33
(form field
labels) 2-7
1
3
Thank you
Tracking
2-7
2.7.3
Alpha
HTML CSS
Cascading Style Sheet
2-5
Macromedia Fireworks(www.macromedia.com/software/fireworks)
2-8
34
2-8
Web HTML
2.7.4 HTML
Web Web
HTMLHTML
Web HTML
HTML HTML
WYSIWYG 2-2
2 Web
2-2
35
HTML
HTML
bug
HTML CSS
HTML CSS
Microsoft
Word HTML
HTML
HomeSite
HTML
CSS
HTML
CSS
FrontPage
HTML
Dreamweaver
HTML CSS
CSS
HTML
HTML 2-3
HTML Web
Dreamweaver HomeSite
2-3
HTML
URL
Dreamweaver
Windows
http://www.macromedia.com/
Macintosh
CSS
DHTML
HomeSite
Windows
http://www.allaire.com/homesite
HTML
Cold
Fusion Studio
36
URL
GoLive
Macintosh
http://www.adobe.com/products/golive/
Macintosh
Windows
Golive
FrontPage
Windows
http://www.microsoft.com/frontpage
Microsoft
HTML
FrontPage Dreamweaver 2-9
2-9
WYSIWYG HTML
HTML HTML
HTML
2 Web
37
100%
HTML
2-10
100%
HTML
WYSIWYG
HTML
HTML
Web
HTML HTML XHTML CSS
HTML
HTML
2.7.5 HTML
HTML
1
XHTML
HTML
HTML
XHTML
38
HTML
HTML HTML
DTD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
HTML
HTML
HTML HTML
HTML HTML
Web <http://
validator.w3.org>CSE Validator (www.htmlvalidator.com)
HTML HTML
<html>
<head>
<title>Messed <b>Up!</b></title>
</head>
<body bgproperties="fixed">
<h1 align="center">Broken HTML
<hr>
<ul>
<p>Is this <b><i>correct</b></i>?<br>
<a href=HTTP://WWW.DEMOCOMPANY.COM>
Visit DemoCompany</a>
<pre>
Should we do <b>this?</b>
How about entities © ?
</pre>
</ul>
</body>
<html>
2-11
2 Web
2-11
39
HTML
HTML HTML
JavaScript
CSS
<link rel="stylesheet" href="styles/pagestyle1.css">
10 JavaScript
<script src="scripts/validate.js" type="javascript"></script>
JavaScript HTML 13
.htm .html
.htm
index.htm
index.html
/about/products
/images/styles
JavaScript /scripts
homeheader.gif r1c1.gif
40
<!----> HTML
HTML HTML
<head>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Demo Company Announces Butler 1.0</title>
<!-Document Name: Butler Robot Press Release
Description: The press release announcing the newest Robot
Butler in the Demo Company family.
Author: Thomas A. Powell (tpowell@democompany.com)
Creation Date: 9/15/00
Last Updated: 9/25/00
Comments: Used SuperDuperEdit 7.0 to build the page.
-->
</head>
<body>
...
</body>
</html>
HTML
10 HTML
HTML HTML
HTML
HTML HTML 2-12
HTML
2 Web
41
HTML
2-12
HTML
Alpha
2.8
Beta
Beta
2.9
Web
bugWeb
bug
42
Web
Web
navigation
AOL AOL
15
2 Web
43
2.9.1
Beta
bug
2.10
Web
2.11
Web
Microsoft FrontPage
Web
44
Web
2.12
Web
HTML
2
3
HTML
HTML
3.1
HTML
HTML
4 HTML
HTML HTML 4.0
idclassstyle title HTML
3.1.1 id
id <p> id
<p id="FirstParagraph">
This is the first paragraph of text.
</p>
FirstParagraph
<style type="text/css">
<!-#FirstParagraph {color: red;}
-->
</style>
<head> FirstParagraph
id bug
id 10 13
2 HTML
46
3.1.2 class
class class id class
FirstParagraph important
class
<style>
<!-.important {background-color: yellow;}
-->
</style>
18
style CSS
id class
CSS 10
3.1.4 title
title
<p title="Introductory paragraph">
This is the first paragraph of text.
</p>
title
tool tip
47
3.1.5
HTML 4.0
HTML dir
ltr rtl
<p dir="rtl">
This is a right to left paragraph.
</p>
ASCII
lang
<p lang="fr">
Cest Francais.
</p>
<p lang="en">
This is English.
</p>
HTML
3.1.6
HTML 4.0 HTML
Web HTML
onclick
<p onclick="alert(Ouch!)">
Press this paragraph
</p>
13 A
Web
HTML
3.2
heading 6 <h1><h2>
2 HTML
48
<h3><h4><h5><h6><h1><h6>
/ HTML
<h1> <h3>
/
3-1
3-1
align
49
align
HTML HTML
3.3
HTML Tab
<p></p>
<p> align
HTML 4.01 align justify
3-2
2 HTML
50
3-2
51
<br><br>
3-3
2 HTML
52
3.4
<div><center>
<center></center>
<center> HTML 3.2 4.0
<center> HTML
HTML 4.01 DTD <center> <div align="center">
<center>
center
<div><img> align
<center><div> 3-4
3-4
<div><center>
53
3.4.1 Spans
<div>
<div><div>
<span>
<span> HTML
class
<div><span>
HTML 10
3.5
<blockquote>
<blockquote> </blockquote>
<blockquote> cite Web
2 HTML
54
<blockquote>
<q><q>
<q> HTML
4.0/4.01 <blockquote><q> cite
<blockquote><q> 3-5
3-5
55
3.6
Tab HTML
Web
Tab
<pre></pre>
<pre>
Courier
<pre><pre>
3-6
3-6
2 HTML
56
<head>
<title>PRE Example</title>
</head>
<body>
<pre>
This is P
R E F
O
R
T
E
X
T
SPACES
are ok!
So are
RETURNS!
</pre>
<br><br>
<p>
This is NOT P
T
E
X
T
SPACES
and
RETURNS are lost.
</p>
</body>
</html>
<pre>
3.7
HTML <ol><ul>
<dl><menu><dir>
57
3.7.1
<ol></ol>
<li>
XHTML</li>
1
<ol>
<li>Item 1</li>
<li>Item 2</li>
. . .
<li>Item n</li>
</ol>
<li>
<li> HTML
<li>
<ol> 3 compactstart type
compact
compact
<ol> type a
AiI
1 1 <ol> type
<li> type
<li> type aAiI 1<li>
type
<li>
<ol> start
XXXI start
j <ol type="a" start="10"> j
10 <li> value
3-7
2 HTML
58
3-7
type="a">Lowercase letters
type="A">Uppercase letters
type="i">Lowercase Roman numerals
type="I">Uppercase Roman numerals
type="1">Arabic numerals
59
<li>This should be j
<li value="3">This should be c
<ol>
<li>Lists can nest
<ol>
<li>Nesting depth is unlimited
</ol>
</ol>
</ol>
</body>
</html>
3.7.2
<ul></ul>
3-8
2 HTML
60
3-8
61
3.7.3
<dl></dl><dt><dt>
definition term
<dd><dt> <dd>
XHTML
<dl> 3-9
3-9
<dir><menu>
HTML
<menu><dir>
HTML
HTML 4.0
2 HTML
62
3.7.4
HTML
3-10
3-10
63
3.8
<hr>
<hr>
<hr>size
width align noshade
HTML 3.2 4.0
color
A
3-11
3-11
2 HTML
64
3.9
HTML <table><form>
Navigator Internet Explorer <frame><layer>
7 11
<address>
3.9.1 <address>
<address>
<address>
Demo Company, Inc.<br>
1122 Fake Street<br>
San Diego, CA 92109<br>
619.555.2086<br>
info@democompany.com<br>
</address>
65
<address>
HTML <address>
<ul>
<p>
3.10
HTML
<b> <i><strong>
<em>
3.10.1
HTML
3-1
3-1
2 HTML
66
<body>
is
is
is
is
is
is
is
is
is
is
is
is
<b>Bold</b>
<i>Italic</i>
<tt>Monospaced</tt>
<u>Underlined</u>
<strike>Strike-through</strike>
also <s>Strike-through</s>
<big>Big</big>
even <big><big>Bigger</big></big>
<small>Small</small>
even <small><small>Smaller</small></small>
<sup>Superscript</sup>
<sub>Subscript</sub>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</body>
</html>
3-12
3-12
<u><big><small>
67
<big><small>
<big><small><big>
<small><big>
<small>HTML 1 7
<big>
3<big> 5<small>
<font> 6 HTML
<big><font size="+1"><small> <font size="1">
3.10.2
HTML
<strong><b>
HTML <strong>
strong Web HTML
<strong>
HTML
HTML
3-2
3-2
<abbr> </abbr>
2 HTML
68
3-13
3-13
69
3.11
title
datetime
<ins><del> 3-14
<center>
3-14
2 HTML
70
3.12
HTML
HTML <>
HTML
escape
&code;
code 3-3
3-3
"
"
"
&
&
&
and
<
<
<
>
>
>
™
N/A
 
©
©
®
®
HTML 3-15
3-15
71
2 HTML
72
<address>
Contents of this page © 1999 Demo Company, Inc.<br>
The <b>Wonder Tag</b> <P> ™ is a registered
trademark of Demo Company, Inc.
</address>
</body>
</html>
HTML C
3.13
--
<head>
HTML HTML
<style><script> 10 13
73
<style>
<head>
<style type="text/css">
H1
{font-size: 48pt; color: red;}
</style>
<style>
HTML
<style type="text/css">
<!-H1
{font-size: 48pt; color: red;}
-->
</style>
<style>
XHTML HTML
A
3.14
HTML
HTML
HTML
HTML
H
hypertext
HTML
HTML
World Wide
Web
4.1
HTML <a>
anchor
HTML
<a>hrefhref URL
URL http://www.democompany.com
<a><a
href="url">Visit our site</a>
Visit our sitehref
<a>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Simple Link Example</title>
</head>
<body>
<h1 align="center">Lots of links</h1>
<hr>
<ul>
<li>Visit <a href="http://www.yahoo.com">Yahoo!</a></li>
<li>Just a <a href="http://www.democompany.com">Demo Company
</a></li>
<li>Go to the <a href="http://www.w3.org">W3C</a></li>
</ul>
</body>
</html>
Web
75
4-1
Demo Company
Demo Company URL
4-1
HTML
<a> URL
URL
76
2 HTML
URL
specs.htmextras
access.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Simple Link Example 2</title>
</head>
<body>
<h1 align="center">Green Gadgets</h1>
<hr>
<p>Here you will find
information about the mysterious green
gadget--the wonder tool of the millennium.</p>
<ul>
<li><a href="specs.htm">specifications</a></li>
<li><a href="extras/access.htm">accessories</a></li>
</ul>
<p align="center">
<a href="../index.htm">Back to Demo Company Home</a>
</p>
</body>
</html>
4.2
URL
URL Internet
URL http://www.democompany.com/
URLInternet
FTP HTML URL
URL
URL
77
4.2.1
Internet
1. Internet intranet
IP
2.
URL
HTTP
URL
protocol://site address/directory/filename
URL
Internet
TCP/IP
Internet
FQDN fully qualified domain name
www.microsoft.com www microsoft.com
Web
2 HTML
78
4-1
4-1
2000
com
apple.com
net
cerf.net
org
greenpeace.org
edu
ucla.edu
gov
whitehouse.gov
mil
nosc.mil
us
K 12
co.san-diego.ca.us
FQDN
machine name. domain name . domain type . country code
ca
mx jp
int
eu.int
comnet
79
Web
http://rs.internic.net/
http://www.iana.org/
http://www.gtld-mou.org/
IP
UNIX Web
/ DOS \ 4-2
4-2
4-2 special
products products
/products/special/ special products
2 HTML
80
./../ special
../ products
Macintosh test:1.htm
test/1.htm Macintosh PC UNIX
MIME 15
Web
Internet
81
HTTP TCP/IP
File
FTP
Gopher
Gopher
mailto
SMTP
SMTP Internet
SMTP
(NNTP)
USENET
News
USENET
telnet
telnet
URL
LDAPIRCInternet
phonefax TV
URL
URL
URL mailto
FTP telnet
username:password@server-address URL
username@server-address
URL
HTTP 80
URL
site-address:8080
2 HTML
82
HTML
URL #
test.htm contents
test.htm#contents<a name=
"contents"></a> 4.4.1 name
URL US-ASCII
URL
ASCII
first quarter
earnings 1999.doc
Web
URL first%20quarter%20earnings%201999.doc
%2020 ASCII URL
/
%2F%3F%25
$ - _ . + ! * URL
HTML
4-2 URL
URL URL
4
4-2
83
Space
%20
%2F
%3F
%3A
%3B
&
%26
%40
%3D
%23
%25
>
%3E
<
%3C
%7B
%7D
%5B
%5D
"
%22
%27
%60
^^
%5E
%7E
%5C
%7C
4.2.2 URL
URL
protocol_name:resource_description
HTTP
HTTP URL
http://server/ (/)
http://www.democompany.com/
HTTP URL
Web http://www.democompany.com http://
www.democompany.com/
index.htm default.htm
84
2 HTML
index.html default.html
http://server/file
http://www.democompany.com/hello.htm
http://server/directory/
http://www.democompany.com/products/
HTTP URL
http://server/directory/file
http://www.democompany.com/products/greeting.htm
UNIX
http://server/~user/
http://www.bigisp.com/~jsmith/
~ UNIX
URL HTML
4.4.1 name
#
85
http://server/directory/file#marker
http://www.democompany.com/profile.htm#introduction
HTML HTTP URL
http://www.democompany.com/images/logo.gif GIF
HTML HTTP
HTML URL
HTTP URL
CGICommon Gateway Interface
CGI 12
HTML
URL
URL
ASCII %20
http://server/directory/file?parameters
http://www.democompany.com/products/search.cgi?cost=400.00&name=Super%
20Part
URL
HTML
12~14
HTTP 80
http://server:port/directory/file
http://www.democompany.com:8080/products/greetings.htm
URL Web 8080
URL
HTTP
SSLSecure Sockets Layer https
443 HTTP
s HTTP URL
https://server:port/directory/file
https://www.welllsfargo.com
HTTP URL URL
URL
2 HTML
86
file
localhost
file:///Macintosh %20HD/Desktop%20Folder/Bookmarks.html
URL pc1 C
file://\\pc1\C\Netlog.txt
Web
Web Web
FTP
FTP
HTTP
ftp://server/directory path/file
ftp://ftp.democompany.com/info/somefile.exe
87
FTP FTP
FTP
FTP
anonymousftp
FTP URL
ftp://user:password@server/directory/file
ftp://jsmith:harmony@ftp.democompany.com/products/list
URL HTML
HTML
URL
ftp://user@server/directory/file
ftp://jsmith@ftp.democompany.com/products/sales
FTP FTP URL
a ASCII
i /
URL d
ftp://server/directory/file;type=code
ftp://ftp.democompany.com/products;type=d
FTP URL
URL 21
mailto
mailto Internet
mailto:user@server
mailto:president@whitehouse.gov
2 HTML
88
Internet
mailto URL
URL
mailto URL
telnet
telnet
telnet URL
telnet://server
telnet://host.democompany.com
telnet
telnet FTP
telnet URL FTP URL
HTML
telnet://user:password@server
telnet://jsmith:harmony@host.democompany.com
telnet://jsmith@host.democompany.com
telnet URL
telnet://server:port
telnet://host.democompany.com:94
telnet 23
URL telnet URL
wais
89
finger VEMMI
URL
URL http://www.w3.org/pub/WWW/Addressing/schemes
http://www.ics.uci.edu/pub/ietf/uri/
4.2.3 URL
URL URL URL
URL
URL
http://www.democompany.com/index.htm
http://www.democompany.com/staff.htm
staff.htm
http://www.democompany.com/index.htm
http://www.democompany.com/
products/gadget1.htm
http://www.democompany.com/products/
http://www.democompany.com/
gadget1.htm
index.htm
products/gadget1.htm
../index.htm
URL
URL
URL
URL../../../images/logo.gif
<base>
HTML
<base>
2 HTML
90
URL<base> href
URL URL <base>
<base href="http://www.democompany.com/">
http://www.democompany.com/ URL <base>
XHTML <base href="http://www.democompany.com/"/>
<base>
URL
HTML <base>
A
4.3
HTML
URL
URLURIURC URN
4.3.1 Anchor
URL Internet
HTML
<a>
URL
<a> href URL
HTTP URL HTML URL
<a>
<a></a>
Linked
content href URL
<a href="URL">Linked content</a>
Web
HTTP
91
HTTP URL
URL
<a href="http://www.democompany.com/products/domes.htm">D.C.
Domes</a>
URL
<a href="http://www.democompany.com/products/domes.htm#top">Go to
top</a>
<a href="products/robots.htm">Robots</a>
URL
<a href="../../index.htm">Back to home</a>
URL
<a href="ftp://ftp.democompany.com">Access FTP archive</a>
HTTP URL
<a href="mailto:info@democompany.com">More information?</a>
HTML URL
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Link Example 3</title>
</head>
<body>
<h1 align="center">Green Gadgets</h1>
<hr>
<p>Here you will find information about the mysterious green
gadget--the wonder tool of the millennium.</p>
<ul>
<li><a href="specs.htm">Specifications</a></li>
<li><a href="extras/access.htm">Accessories</a></li>
<li><a href="http://www.democompany.com">Distributors</a></li>
<li><a href="ftp://ftp.democompany.com/pdfs/order.pdf">
Download order form</a></li>
</ul>
2 HTML
92
<div align="center">
<a href="../index.htm">Back to Demo Company Home </a>
</div>
<hr>
<address>
Questions?
<a href="mailto:info@democompany.com">info@democompany.com</a>
</address>
</body>
</html>
4-3
4-3
4.3.2
0
HTML <body> linkalink
vlink link vlink
alink
HTML HTML
93
HTML
HTML
HTML
4.4
A <a>
4-4
href
URL
name
id
2 HTML
94
target
title
accesskey
tabindex
tab tab
rel
rev
4.4.1 name
<a>
HTML <a>
<a>
<a>
95
<a name="top"></a>
<a href="#top">Top of the document</a>
#
HTML URL
#
<a href="http://www.democompany.com/products/robots.htm#specs">
Robot Specs</a>
robots.htm specs
4.4.2 Title
3 title
title
Internet
2 HTML
96
Explorer
title
<a href="staff/index.htm" title="Resumes and information about our
staff">Staff</a>
4-4
title
<title>
title title
4.4.3
HTML 4 <a> accesskey
11 accesskey
ALT
<a href="http://www.yahoo.com/" accesskey="Y">Yahoo!</a>
Yahoo! ALT+Y
97
Netscape Communicator 4
Netscape
HTML 4-5
4-5
File
Edit
Communicator
View
Go
Favorites
Netscape Communicator
Internet Explorer
4.4.4 tabindex
<a> tabindex tab
tabindex tab
tabindex <a
href="about.htm" tabindex="1"> tab
tabindex
4.4.5 target
target 8 HTML 4
target <a>
target
2 HTML
98
URL display_frame
target
target _blank_self_parent
_top<a>
A 8
4.4.6
<a>
rel href
rev rel
rel nextrev
prev
rel rev
<a><link>
rel rev
rel rev
4.4.7
JavaScript HTML 4 , <a>
onclick, onmouseover, onmouseout
onclick
onmouseover
onmouseout
Netscape
F1 HTML
13
4.5
99
<a>
HTML
<img><img> 5
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Anchors and Images</title>
</head>
<body>
<b>Button with a border</b><br>
<a href="about.htm">
<img src="about.gif" alt="About Button" height="55" width="55">
</a>
<br><br>
<b>Same button without a border</b><br>
<a href="about.htm">
<img src="about.gif" alt="About Button" border="0" height="55"
width="55">
</a>
</body>
</html>
border "0"
<img></a>
4-5
<img></a>
4-5
100
2 HTML
Web
4.6
URL
1.
2. Web URL
Imagemap
3. URL
4. URL
URL
x y
URL HTML
URL
101
4.6.1
<a>
<img><a> href URL
<img> ismap
4-6
<img> border
0
4-6
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Server-side Image Map Example</title>
2 HTML
102
</head>
<body>
<h1 align="center">Server-side Imagemap Test</h1>
<div align="center">
<a href="http://www.htmlref.com/examples/chapter4/shapes.map">
<img src="shapes.gif" ismap border="0" width="400" height=
"200"></a>
</div>
</body>
</html>
4-6
URL
HTML
4.6.2
<img> usemap <map>
<img><img src=
"controlbar.gif" usemap="#controlmap">
<a><img> border
0
<map>
<map>
HTML
<area>
shape
coords
x, y
href
URL
id
103
target
nohref
N/A
alt
title
tabindex
tab
onclick
onmouseover
onmouseout
shape="default"
4-7 area
4-7
<area shape="rect"
coords="0,0,100,50"
href="about.htm">
<area shape="circle"
coords="25,25,10"
href="products.htm">
<area shape="poly"
coords="255,122,306,53,334,62,255,122"
href="contact.htm">
(0,0) x y
<area shape="rect"
coords="0,0,50%,50%">
2 HTML
104
HTML HTML
Allaire Homesite (http://www.allaire.com) Macromedia Dreamweaver
(http://www.macromedia.com) 4-7
4-7
4-8
4-8
105
<body>
<h1 align="center">Client-side Imagemap Test</h1>
<div align="center">
<img src="shapes.gif" usemap="#shapes" border="0" width="400"
height="200">
</div>
<!-- start of client side image map -->
<map name="shapes">
<area shape="rect" coords="6,50,140,143" href="rectangle.htm"
alt="rectangle">
<area shape="circle" coords="195,100,50" href="circle.htm"
alt="circle">
<area shape="poly" coords="255,122,306,53,334,62,338,0,388,77,
374,116,323,171,255,122" href="polygon.htm" alt="polygon">
<area shape="default" href="defaultreg.htm">
</map>
</body>
</html>
ismap
usemap
<a href="shapes.map">
<img src="shapes.gif" usemap="#shapes" border="0" ismap width="400"
height="200"></a>
4.6.3
<area>
<img> border
target
<a><area>
target target
target
href URL"display_frame"
target
target _blank_self_parent _top
2 HTML
106
<area>
A 8
nohref
nohref
nohref nohref
""
"" ""
Netscape
Internet Explorer
nohref
<map>
<area>nohref
nohref <area>
<area> URL
alt title
alt
title
alt alt title
alt
107
alt
4-9
4-9
HTML
4-10
ismap
2 HTML
108
4-10
HTML
tabindex
HTML 4 <area>
tabindex tab
tabindex tabindex
tab
<area shape="rect" coords="0,0,50%,50%"
href="http://www.yahoo.com/"
tabindex="1">
tabindex HTML
JavaScript VBScript
<area>onclick, onmouseover onmouseout
<area>
4.7
109
<link>
title
HTML <link>
<link>
<link><link>
<link>
<link> HTML
href rel<a> href href URL rel
rel <link>
<link href="url" rel="relationship"> HTML 4 <link>
rev title title <link>
rel rev
4.7.1
<a> rel <link> rel
rel
HTML 4 4-8
4-8
rel
alternate
<link href="frenchintro.htm"
lang
appendix
rel="alternate" lang="fr">
<link href="intro.htm"
rel="appendix">
bookmark
title
<link href="index.htm"
rel="bookmark"
title="homepage">
chapter
<link href="ch01.htm"
rel="chapter">
2 HTML
110
contents
<link href="toc.htm"
index
rel="contents">
<link href="docindex.htm"
rel="index">
glossary
copyright
<link href="glossary.htm"
rel="glossary">
<link href="copyright.htm"
rel="copyright">
<link href="page2.htm"
next
WebTV
rel="next">
prev
<link href="page1.htm"
section
<link href="sect07.htm"
rel="previous">
start
rel="section">
<link href="begin.htm"
rel="start">
stylesheet
<link href="style.css"
rel="stylesheet">
subsection
<link href="sect07a.htm"
rel="subsection">
help
<link href="help.htm"
rel="help">
HTML 4 HTML
prev next rel
rev
4.7.2 WebTV <link>
<link> WebTV WebTV <link>
rel next href
WebTV
<link> <link rel="next"
href="second.htm"> second.htm
111
4.7.3 <link>
<link> typemedia target
Internet Explorer Netscape<link>
HTML
<link rel="stylesheet" href="corpstyle.css"> corpstyle.css
rel stylesheet
alternate stylesheet
title
title
basestyle.css 640480 1024768
Web
title
<link> type
type
type
type MIME
<link> media
media printprojectionscreenbrailleaural
tv all all
2 HTML
112
Internet
4.8
Star Trek
Internet
URL
4.8.1 URL
URL URL
URL
URL
URL
URL
404 Not Found
URL
http://pint.com/about
URL http://www.democompany.com/prod1
http:// http://
URL
URL DNS
HTML 4 W3C
Internet
W3C DNS
URL
Internet
113
ISBN
URL HTML 4
URL
URL
URN
URNURC URI
URNUniform Resource Name
DNS
URN URL IP
URN
URN www.democompany.com
IP 192.102.249.3
DNS URL
URN URL URN
URL DNS
URN urnbooktitle ,
urn:isbn0-12-518408-5
URC
URCUniform Resource Characteristic
Uniform Resource Citation
/
URC <meta> PICS URC
2 HTML
114
http://www.democompany.com/about/corp.htm
http://www.democompany.co.jp/about/corp.htm.
URI
URL PURLs
(www.purl.org) Handles (www.handle.net) URN URC
URN
URC
URL URI
URL
4.8.3 URL
URL Internet URL
Internet
WebTV
URL
URL tv://channelchannel
nbc or nbc7-39
URL
nbc URL
phone://phone-number
phone://+1-555-270-2086
fax://phone-number
115
URL
clip
URL URL URL
mozart.audio 2:05
URL
URL W3 www.w3.org/Addressing/
4.9
URL
Internet URL
URL
URL<a>
HTML
<link>
<a> rel rev <link>
16
<meta>
HTML
URNURC URL
URI URN
HTML
3
5
HTML
HTML
Web
5.1
HTML
Web GIF (Graphics Interchange Format
.gif) JPEGJoint Photographic Experts Group.jpg .jpeg
Web
.gif
.jpg .jpeg
XBMX Bitmaps
.xbm
XPMX Pixelmaps
.xpm
.png
Web GIF
5 HTML
117
JPEG
5-2 GIF JPEG
5-2 Web
GIF
8-bit256
24-bit
JPEG
5.1.1 GIF
GIF 8 256
(Dithering)
118
GIF Transparency
GIF halo
effectanti-aliasing
GIF interlacing
5-1
5 HTML
119
(Previsualization)
GIF
GIF
5-1
GIF
5-2
5-2
GIF
120
8 GIF
GIF Web
GIF JPEG
GIF
gjg
5.1.2 JPEG
JPEG.jpg
.jpeg JPEG Joint Photographic Experts Group
JPEG
JPEG 24 GIF
JPEG
5-3 JPEG
JPEG
JPEG GIF
JPEG
Web GIFJPEG
progressive JPEG Progressive JPEG
GIF Progressive JPEG
Netscape
2.x progressive JPEG
5-3
GIF JPEG
5.1.3 PNG
Portable Network GraphicsPNG GIF89a
5 HTML
121
Gamma 8-bit
PNG PNG GIF
5.1.4
GIFJPEG PNG Flash
.swf Scalable Vector GraphicsSVG
Fractal Wavelet
Web HTML
5.2
HTML
<img><img> src
URL 4 URL URL,
URLimage URL logo.gif
GIF
<img src="logo.gif">
<img src="http://www.democompany.com/images/logo.gif">
URL
images
robot.gif GIF
Macintosh
GIF HTML <img>
122
5-4
5-4
<img>
5.2.1 alt
alt
5-5 alt
title alt
title
alt title
5 HTML
5-5
123
alt 1024
Netscape 4
Netscape Microsoft
text-only 5-6
Netscape Lynx
5-6
124
text-only
pwWebSpeakwww.issound.com
1 2
Web
alt
alt accessibility
Demo
Demo
Demo
Demo
alt=" "
alt
alt
5.2.2
HTML 2 align
3 topbottom middle
align
align HTML 2
5-7
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
5 HTML
125
5-7
HTML
5-8
5-8
126
5-9
5 HTML
127
<br>
align
<img>align center
middle center
<p align="center">,<div align="center">
<center>
Netscape Microsoft align texttopbaselineabsmiddle
absbottom
Style sheets 10
align texttop
baseline
baselineadsmiddle adsbottom
yg
adsbottom baseline g
hspace vspace
pixel
hspace
vspace ()
5-10
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>HSPACE and VSPACE Example</title>
</head>
<body>
<p>The image below has its <tt><b><HSPACE></b></tt> and
<tt><b><VSPACE></b></tt> attributes set to 50 pixels, so the
text will flow around it at a distance of 50 pixels. The rest of this
text is dummy text. If it said anything interesting you would certainly
be the first to know.
<img src="images/redsquare.gif" align="left" hspace="50"
vspace="50">
This is dummy text. If it said anything interesting you would certainly
128
5-10
hspace vspace
10
5-11
5 HTML
5-11
129
clear <br>
HTML clear
clear leftrightall noneleft
right
all
clear none
<br> clear
5-12
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Break and Clear Example</title>
</head>
<body>
<img src="images/building.jpg" width="234" height="150" border="2"
alt="Outside of the DemoCompany corporate headquarters"
align="left" hspace="20" vspace="10">
<b>Photo:</b> Demo Company, Inc Corporate Headquarters<br><br>
<b>Description:</b> This building is a fine example of the <i>Miami
Vice</i> influence on mid-80s southern California architecture.
<br><br>
The next paragraph should appear under the photo, not next to it,
thanks to the <tt><br clear="left";</tt>.
130
<br clear="left">
<i>Photo copyright © 1999 by Demo Company, Inc.</i>
</body>
</html>
5-12
<br clear>
5.2.5
HTML 3.2 <img> height weight
1~100
test.gif 10
150<img src="test.gif" height="10" weight="150">height weight
<img>
height weight
height weight
height weight
<img
5 HTML
131
height weight
height weight
1
5.2.6
Netscape <img> lowsrc
HTML 4 lowsrc URL
src lowsrc
lowsrc
lowsrc height weight
lowsrc lowsrc
Netscape
lowsrc
lowsrc src
( T1)lowsrc
src
GIF GIF src lowsrc
<embed><object> Flash
9
132
<img> A <img>
5.3
4 <a>
URL
5-13 URL
5-13
border 0 :
<a href="http://www.democompany.com"><img src="logo.gif"
border="0"></a>
5-14
5 HTML
5-14
133
JavaScript
13 JavaScript
border
border
border <img src="portrait.gif"
border="5">
5.4
4 image map
URLserver
sideclient side
URL HTML
URL
URL
text-only
134
5.4.1
<a><img>
<a> href URL
<img> ismap
<img> border 0
4
HTML
5.4.2
<img> usemap
<map><img><img src=
"controlbar.gif" usemap="controlmap"><img> border
0<map> HTML body
<map> HTML
<map>nameidentifier
<img> usemap <map>
</map><map></map>"shapes"
shapes <area><map> 4
Macromedia Dreamweaver
Allaire HomeSite
MapEdit www.boutell.com/mapedit
usemap ismap
<a href="shapes.map">
<img src="shapes.gif" usemap="#shapes" border="0" ismap width="400"
height="200"></a>
<area>
<img> border 4 A
5 HTML
135
5.4.3 <object>
<img>alternative rendering<object>data
URL
<object>
<object>
A
5.5
HTML
Web
DesignThe Complete Reference
http://www.webdesignref.com
5.5.1
Web Web
136
Eyewirewww.eyewire.com
5.5.2
fair use
fair use
fair-use
fair use
(creative)(factual)
fair use
Paramount Pictures
Paramount
5.5.3
GIF JPEG
5 HTML
137
GIF
30 32 5-bit
8-bit Macromedia Fireworks Adobe Photoshop
GIF
Progressive JPEG
HTML
altheight weight alt
height weight
Amazon Yahoo!
138
5.6
<img> altheight
width lowsrcaccessibilityusability
HTML
<img>
align
<object><img>
HTML
HTML
<ul>
HTML
CSSCascading
Style Sheets HTML CSS
HTML
6.1
Web
20
4
Web
140
6.2
Web HTML
HTML
HTML
align <spacer>
<multicol> HTML
CSS
HTML
6.2.1 HTML
HTML
<ul>
6-1 http://www.htmlref.com/examples/chapter06/
ulindentation.htm
HTML <blockquote>
WYSIWYGindent
HTML
6-1
141
<ul>
HTML <pre> 3
<pre>Tab <pre>
Courier
tab <pre>
  
  
 
Now we are ten spaces from the left!
 
 
 
<p> </p>
142
<br><br>
 
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
<ul>
<li>Item 1<br><br></li>
<li>Item 2<br><br></li>
<li>Item 3<br><br></li>
</ul>
 
<ul>
<li>Item 1<sub> </sub></li>
<li>Item 2<sub> </sub ></li>
<li>Item 3<sub> </sub ></li>
</ul>
HTML
143
6.2.3 <center>
Netscape <center>
<center>
HTML
<center>Welcome to Demo Company!</center>
<center><center>
HTML 4 <center><div
align="center">align
6.2.4 Alignment
HTML 3.2 HTML 4.0 <center> align
<div> align leftcenter right HTML 4.0
justify align ltr
left to right rtlright to left
justify
IE Netscape
<p>,<table><h1><h2><h3><h4><h5><h6> align
align
5 <img> align
6.2.5 <nobr><wbr>
Microsoft
Netscape <nobr><wbr>
<nobr>
<nobr>
<nobr>
144
WebTV
80%<nobr> WebTV
WebTV
<nobr><wbr><nobr>
<wbr> HTML <wbr>
<br><nobr>
<wbr><wbr>
<wbr>
<nobr>This is a very important long line of text that should not
break across two lines. If the line must be split, it should
happen here <wbr> and nowhere else.</nobr>
<wbr><nobr>
6.2.6
5 HTML 2.0 <img> align topbottom
middle align
align
HTML
Netscape align left right
image <img src="logo.gif" align="left">
<img src="logo.gif"
align="right">,
5 A
clear <br>
HTML clear
clear leftrightall none
clear none<br>
<br clear="left">
<br clear="right">
<br clear="all">
145
align <br>
<img>
hspacevspace align
6.2.7
QuarkXPress
QuarkXPress
HTML alignhspace
vspace
width
10
<p><img src="pixel.gif" width="10" align="left">This is the start
of the paragraph.</p>
HTML 10
10
hspace vspace
CSS
<img> height width align
<img src="pixel.gif" height="100" width="50" align="left">
pixel.gif stop
6-2
Netscape <spacer>
146
6-2
6.2.8 <spacer>
Netscape 3.0 <spacer>
<spacer>
<spacer>
type horizontalvertical
block
75
<spacer><spacer>
24 <spacer>
<spacer> type
horizontal
vertical block <spacer>
HTML 150 100
... text...
<spacer type="block" height="150" width="100" align="left">
... text...
align bottom
147
<spacer><br clear="left">
<spacer> Netscape
alt
<spacer>
6.2.9 <multicol>
<spacer> Navigator 3.0 <multicol> Netscape
<spacer>
Netscape Internet Explorer
Netscape
<spacer><spacer>
HTML
<multicol> cols
<gutter>
10 <multicol><width>
width
cols
<multicol>
<multicol
cols="number of columns"
gutter="gutter width in pixels or percentage"
width="column width in pixels or percentage">
Text to put in column form
</multicol>
<multicol> http://www.htmlref.com/examples
/chapter06/multicol.htm 6-3
Internet Explorer IE <multicol>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>MULTICOL Example</title>
</head>
148
<body>
<multicol cols="2" gutter="50" width="80%">
This only works in Netscape, so dont try this at home!
The rain in Spain falls mainly on the plain. Now is the time
for all good men to come to the aid of the country. Theres
no business like show business. The rain in Spain falls
mainly on the plain. Now is the time for all good men to
come to the aid of the country. Theres no business like
show business. The rain in Spain falls mainly on the plain.
Now is the time for all good men to come to the aid of the
country. Theres no business like show business. The rain
in Spain falls mainly on the plain. Now is the time for all
good men to come to the aid of the country. Theres no business
like show business. The rain in Spain falls mainly on the plain.
The rain in Spain falls mainly on the plain.
</multicol>
</body>
</html>
6-3
<multicol>
6-4
<wbr><multicol>
cols 6 6-5
<wbr>
6-4
6-5
149
<multicol>
<multicol>
<multicol> Netscape
<blink><marquee><bgsound><multicol>
HTML
7 10 HTML
6.3
HTML 2.0
150
#ff0000RGB E
This is important<font>
<font> size 7
1 7 1 7
<font size="7">This is big</font> 3
<basefont>
<font size="+1">
+
size +1 +61 6<font
size="+10"> 7
151
HTML
face
Macintosh
UNIX*
Arial
Chicago
Charter
Comic Sans MS
Courier
Clean
Courier New
Geneva
Courier
Impact
Helvetica
Fixed
Monaco
Helvetica
Symbol
New York
Lucida
Verdana
Palatino
Sans Serif
Wingding
Symbol
Serif
Times
Symbol
Times
Utopia
* UNIX X Windows
152
6-6
Microsoft Office
AlgerianBook Antiqua
Bookman Old StyleBritannic BoldDesdemonaGaramond
Century GothicHaettenschweiller
Internet Explorer 4.0 Microsoft WebDings
WebDings
6-7
6-7
Microsoft WebDings
W3C
Microsoft
&audio
WebDings GIF
<font> 6-8
6-8
<font>
153
154
font</font><br>
Even set text to dingbat characters
<font face="Webdings">f3khilqm </font><br>
<h2 align="center">Common Font Face Combinations</h2>
<font face="Arial,Helvetica,sans-serif">
Arial,Helvetica,sans-serif</font><br>
<font face="Verdana, Arial, Helvetica, sans-serif">
Verdana, Arial, Helvetica, sans-serif</font><br>
<font face="Times New Roman,Times,serif">
Times New Roman,Times,serif</font><br>
<font face="Georgia, Times New Roman, Times, serif">
Georgia, Times New Roman, Times, serif</font><br>
<font face="Courier New, Courier, monospace">
Courier New, Courier, monospace</font><br>
<h2 align="center">Combination</h2>
You can <font size="+2" color="red" face="Arial">set all font
attributes at once!</font>
</body>
</html>
6.3.1
<head><basefont><basefont>
colorface size <font> color RGB
RGB hexadecimal equivalent valueface
size 1 7
<basefont>+
"" "
" ""
6.3.2
Microsoft Windows
WindowsMacintosh UNIX
155
Microsoft OpenTypewww.microsoft.com/
typography
6.3.3 Netscape
Netscape <font> face
10
156
.pfr GIF
6.3.4 Microsoft
Microsoft
<font> 10
6-9
Netscape
@font-faceMicrosoft
W3C Internet Explorer
WEFT Microsoft Typography
157
www.microsoft.com/typography
6-9
" "
6.4
HTML
HTML 4.0
HTML 4.0 16
HEX RGB 6-2
<font color="yellow"></font>
6-2
E
Netscape Microsoft
Internet Explorer
<body bgcolor="html color names are troublesome">
6-2
HTML 4.0
Black (#000000)
Green (#008000)
Silver (#C0C0C0)
Lime (#00FF00)
Gray (#808080)
Olive (#808000)
White (#FFFFFF)
Yellow (#FFFF00)
Maroon (#800000)
Navy (#000080)
Red (#FF0000)
Blue (#0000FF)
158
Purple (#800080)
Teal (#008080)
Fuchsia (#FF00FF)
Aqua (#00FFFF)
RGB RGB
0~255
00~FF 0,255,0 00,FF,00
FF,FF,FF
HTML # RRGGBB RGB
color #FFFF00 yellow
E HTML
http://www.htmlref.com/Reference/AppE/colorchart.htm
6.5
<body>
<body> body
<body>bgcolor
Mosaic Macintosh
<body>
RGB
bgcolor bgcolor
<body bgcolor="#FFFFFF"><body bgcolor="white">
<body> text
<body bgcolor="white" text="green">
<font> color
<body>
<body> linkalink vlink
link HTML
159
alink
alink link
vlink vlink
vlink
(linkalinkvlink)
Gamma
160
6.6
<body> background
background GIF JPEG URL
<body background="images/tile.gif">
URLbackground
background 200300
6-10
6-10
Photoshop
6-11
6-11
161
5 1600 GIF
GIF 200
1600
6-12
6-12
GIF
6-13
6-13
( GIF)
162
10
HTML
6.7
HTML <body>
<body topmargin="0" leftmargin="0" marginheight="0" marginwidth
="0">
<head><style>
<style type="text/css">
<!--
6
body
-->
</style>
163
{margin: 0px; }
CSS
HTML 4 XHTML
6.8
HTML
HTML
HTML
GIF
<spacer>
HTML
HTML
HTML
<table> Web
10
7.1
HTML
HTML
Web
HTML
HTML
HTML
7.1.1
HTML 4 HTML
<table>...</table><tr>...</tr>
<th> </th><td> </td>
border 1
7-1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Simple Table Example</title>
</head>
<body>
<table border="1">
<caption>Basic Fruit Comparison Chart</caption>
<tr>
<th>Fruit</th>
<th>Color</th>
165
</tr>
<tr>
<td>Apple</td>
<td>Red</td>
</tr>
<tr>
<td>Avocado</td>
<td>Green</td>
</tr>
<tr>
<td>Watermelon</td>
<td>Pink</td>
</tr>
</table>
</body>
</html>
7-1
<tr></tr><tr>
<td></td><th>
</th><table> cols
Internet Explorer 4
<table border="1" cols="2">
<th>
<td><td><th>
<caption></caption>
caption
HTML <tr><th><td>
HTML HTML
166
Netscape
XHTML
rowspan colspan
7-2
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Rowspan and Colspan Example</title>
</head>
<body>
<table border="1">
<caption>ROWSPAN Example</caption>
<tr>
<td rowspan="2"> Element 1</td>
<td> Element 2</td>
</tr>
<tr>
<td> Element 3</td>
</tr>
</table>
<br><br>
<table border="1">
<caption>COLSPAN Example</caption>
<tr>
<td colspan="3"> Element 1</td>
</tr>
<tr>
<td> Element 2</td>
<td> Element 3</td>
<td> Element 4</td>
</tr>
</table>
</body>
</html>
7-2
167
168
<tr>
<td>4</td>
<td>5</td>
</tr>
</table>
<table> <td><th>
<caption>
169
<table>
7.1.3
HTML
10 Web
border 0<table>
border
100
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
170
<head>
<title>Table Layout with Background</title>
</head>
<body background="yellowtile.gif">
<table width="550">
<tr>
<td width="100">
<a href="about.htm">About</a><br><br>
<a href="products.htm">Products</a><br><br>
<a href="staff.htm">Staff</a><br><br>
<a href="contact.htm">Contact</a><br><br>
</td>
<td width="450">
<h1 align="center">Welcome to Demo Company, Inc.</h1>
<hr>
<p>This text is positioned over a white background;
the navigation links are over a colored background.
This layout combines a table with a background images.
</p>
</td>
</tr>
</table>
</body>
</html>
7-3 <body>
bgcolor bgcolor Netscape
Navigator 3 Internet Explorer
10
7-3
HTML
171
sticky HTML
HTML
<table align="left" bgcolor="#ffffcc" cellpadding="20" hspace="15"
vspace="15">
<tr>
<td>This is an important point!</td>
</tr>
</table>
<table> bgcolor
RGB cellpadding
sticky width
bgcolor bgcolor
<table><tr><th><td>
<table border="1" cellspacing="0" cellpadding="8" bgcolor="green">
<tr>
<th bgcolor="lightblue">a</th>
<th bgcolor="lightblue">a</th>
<th bgcolor="lightblue">a</th>
</tr>
<tr bgcolor="orange">
<td>b</td>
<td>b</td>
<td>b</td>
</tr>
<tr>
<td bgcolor="red">c</td>
<td bgcolor="white">c</td>
<td bgcolor="blue">c</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
th
tdtr
<td> bgcolor
172
<table>
7-4
7-4
<table> cellspacing
0 Internet Explorer Opera
cellspacing
0
<thead><tfoot> HTML 4.0
bgcolor IE 4
Netscape 4
Internet Explorer
Netscape 5
Internet Explorer 4 bordercolor tr
thtd
173
Internet Explorer 4
Netscape
Microsoft
<table cellspacing="0" cellpadding="0" border="0" width="200">
<tr>
<td bgcolor="#000000">
<!-- begin nested table -->
<table cellspacing="1" cellpadding="3" border="0" width="200">
<tr>
<td bgcolor="#FFFFFF" width="100">Cell 1</td>
<td bgcolor="#FFFFFF" width="100">Cell 2</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" width="100">Cell 3</td>
<td bgcolor="#FFFFFF" width="100">Cell 4</td>
</tr>
</table>
<!-- end nested table -->
</td></tr></table>
bgcolor black
bgcolor white cellspacing 1
Netscape Netscape 3
background Microsoft
174
Internet Explorer
Netscape
height width
175
colspan
<td><table> cellpadding
10 7-5
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>2-Column Document Layout with Table</title>
</head>
<body>
<table cellspacing="0" cellpadding="10" border="1" width="550">
<tr>
<td colspan="2" align="center">
<font face="arial black, helvetica, sans-serif" size="+2">
FEZ: IMPERIAL JEWEL OF MOROCCO</font></td>
</tr>
<tr>
<td width="50%" valign="middle">
<font face="arial, helvetica, sans-serif" size="+1">
<b>Beyond the Bou Jeloud Gate....</b></font></td>
<td width="50%" align="center">
<img src="boujeloud002.jpg" width="240" height="185" border="0">
</td>
</tr>
<tr>
<td colspan="2" align="center">
<font face="Arial, Helvetica, Sans-serif">
<b><i>Luckily, a major UNESCO restoration project is
now underway...</i></b></font></td>
</tr>
<tr>
<td width="50%" valign="top">Part of the problem....</td>
<td width="50%" valign="top">Major landmarks....</td>
</tr>
</table>
</body>
</html>
176
7-5
useless products.
<br><br>
To learn more about our products or our growing monopoly,
click on any of the links to the right.</td>
<td rowspan="3" width="68" valign="top">
<img src="curve.gif" border="0" height="108" width="68">
</td>
<td colspan="2" width="193" valign="top">
<img src="blank.gif" border="0" height="35" width="193">
</td>
</tr>
<tr>
<td colspan="2" width="193" valign="top">
<img src="widgets.gif" border="0" height="35" width="193">
</td>
</tr>
<tr>
<td colspan="2" width="193" valign="top">
<img src="gadgets.gif" border="0" height="38" width="193">
</td>
</tr>
<tr>
<td colspan="2" rowspan="4" width="136" valign="top">
<img src="gear.gif" border="0" height="140" width="136">
</td>
<td valign="top" width="125">
<img src="sales.gif" border="0" height="29" width="125">
</td>
</tr>
<tr>
<td valign="top" width="125">
<img src="about.gif" border="0" height="36" width="125">
</td>
</tr>
<tr>
<td valign="top" width="125">
<img src="history.gif" border="0" height="35" width="125">
</td>
</tr>
<tr>
<td valign="top" width="125">
<img src="map.gif" border="0" height="40" width="125">
</td>
</tr>
<tr>
177
178
cellpadding cellspacing 0
height width
7-6
7-6
GIF JPEG
JPEG GIF
colspan rowspan
179
Fireworks
colspan
<br>
180
HTML
7.1.4
colspan rowspan
background <td>
<table><tr>
Microsoft bordercolorbordercolordark bordercolorlight
IE intranet
rowspan colspan
7.1.5
181
HTML 4
5 <table><caption><tr><th><td>
HTML 4
<col><colgroup><thead><tfoot><tbody> HTML 4 HTML
<table>
<caption> . . . </caption>
<thead><tfoot>
<tbody>
<tr>
<th><td>
<colgroup><col>
</table>
HTML 4
<thead><tfoot>
Microsoft
HTML 4
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>HTML 4.0 Tables</title>
</head>
<body>
<table border="1" frame="box" rules="groups">
<caption>Fun with Food</caption>
<colgroup>
<col>
</colgroup>
<colgroup>
<col align="center">
<col align="char" char=".">
</colgroup>
<thead>
<tr>
<th bgcolor="yellow">Fruit</th>
<th bgcolor="yellow">Color</th>
<th bgcolor="yellow">Cost per pound</th>
</tr>
</thead>
<tbody>
<tr>
182
<td>Grapes</td>
<td>Purple</td>
<td>$1.45</td>
</tr>
<tr>
<td>Cherries</td>
<td>Red</td>
<td>$1.99</td>
</tr>
<tr>
<td>Kiwi</td>
<td>Brown</td>
<td>$11.50</td>
</tr>
</tbody>
<tfoot>
<tr>
<th colspan="3">This has been another fine table example.</th>
</tr>
</tfoot>
</table>
</body>
</html>
<thead> <tfoot>
<tbody>
<thead><tfoot><tbody>
<tbody>
<thead><tfoot><tbody> body
col align char align
char
<col align="char" char=".">
183
7.2
Microsoft
Microsoft background
bordercolorbordercolordarkbordercolorlight
accesskeytabindex hidefocus accesskey tabindex Internet
Explorer 4 5
hidefocus Internet Explorer 5.5
accesskey tabindex Tab
hidefocus tabindex
A
Microsoft datapagesize datasrc
Internet Explorer 4
7.3
184
CGI
HTML HTML
Microsoft HTML
HTML
HTML
<object> HTML
15 <object><object>
ActiveX HTML
HTML
HTML
alphabet.txt
Letter, Thing
A, Apple
B, Boy
C, Cat
D, Dog
E, Elephant
F, Fox
G, Girl
H, Hat
HTML
185
HTML alphabet.txt
Internet Explorer 4
7-7
7-7
Internet Explorer 4
186
ActiveX
<table> datasrc
<object>
#<object> id
datasrc
datafld
"Column1""Column2"
<td> datafld <td>
datafld <span>
<div><object><img>
<img datafld="Picture"> datafld
mypict.gif
Microsoft datapagesize
<table>
<table datasrc="#alphabet" border="1" datapagesize="3">
alphabet.txt AB C
<thead><tfoot>
<tbody>
7.4
187
HTML
10
8
frame layer
HTML Web
frame
8.1
8-1
8-1
189
URL
Web
frame-phobic Web HTML 4
8.1.1
Web Web
URL
8.1.2
8-2
20% links.htm
80% display.htm
basicframes.htm
basicframes.htm HTML
<frameset> <body> <frameset>
rows cols
<frameset cols="20%, 80%"><frameset rows="10%, 80%,
10%"> 10%80% 10%
<frameset> <frame><frameset>
<frame><frame src="URL of framed document"
name="unique frame name">
190
8-2
Internet Explorer
links.htm 20%
display.htm 80%<frame>
<frameset>
<frame>src
URL links.htm display.htm
links.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
191
<head>
<title>Links</title>
</head>
<body>
<h2>Links</h2>
<hr>
<a href="http://www.democompany.com" target="display">Demo
Company</a>
</body>
</html>
display.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Display</title>
</head>
<body>
<h2>Display</h2>
<hr>
<p>Contents of second frame and link clicks will be displayed here.</p>
</body>
</html>
basicframes.htm
8-2 http://www.htmlref.com/examples/
chapter08/basicframes.htm
8.1.3 <noframes>
<noframes> HTML
Web <noframes> <frameset>
<noframes> <frameset>
XHTML<noframes>
<body> HTML HTML 4 <noframes>
<body>
192
<hr>
<a href="http://www.yahoo.com">Yahoo</a>
<br>
<a href="http://www.microsoft.com">Microsoft</a>
<br>
<a href="http://www.netscape.com">Netscape</a>
</body>
</noframes>
</frameset>
</html>
Netscape 1.x
8-3
8-3
PDA
indexing spider <noframes>
<noframes>
<noframes>
8.1.4
control
display
1. <frame> name
193
window1
frame3
displayregionHTML
id name
id id
<frame> id name
target
8-1
8-1
target
_blank
_self
_parent
_top
target _top
target _top
target _top
target _blank
JavaScript 13
_parent _parent
target _self
HTML target
links.htm
<a> target http://www.htmlref.com/examples/chapter08/
frametargetting.htm linktargets.htm
194
mysterywindow
8-4
8-4
8.2
195
rows cols
<frameset cols="200,400"> 200
400 600
150
175
175
*<frameset cols="175,*">
3
<frameset rows="100, *, 50">
<frame src="header.htm" name="header">
<frame src="display.htm" name="display">
<frame src="footer.htm" name="footer">
</frameset>
<frameset>
3
8-5 http://www.htmlref.com/examples/chapter08/
nestedframes.htm
<frame>
<frameset>
8-6 http://www.htmlref.com/examples/
chapter08/fixedframes.htm
196
8-5
8-6
197
blue.htm center.htm
blue.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Blue</title>
</head>
<body bgcolor="blue">
<!-- just a blank document -->
</body>
</html>
center.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Center</title>
</head>
<body bgcolor="white">
<h2 align="center">Frame Fun!</h2>
</body>
</html>
Internet Explorer
<frameset> framespacing 0
scrolling Auto
yes no
noresize
198
marginheight marginwidth<body>
Netscape
0
<frame src="blue.htm" name="right" marginwidth="0" marginheight=
"0">
Microsoft
HTML 4
<frame><iframe><iframe>
</iframe> HTML
199
<a> target
<iframe> <img><object>
A <iframe>
8-7
<iframe>
200
8.2.2
Web
8.2.3
URL
Netscape 2
Back
Internet Explorer
Netscape
URL
Internet Explorer 4
Microsoft
201
<noframes>
8.3
HTML Web
CSS <frame>
HTML
10
HTML
1993 Mosaic
9.1
Web MIDI
KHzCD
44.1KHz 44100 8 bits
16 bits CD 705600 bits 44100
16=705600
CD bits Internet
T1
8KHz
64000 bits
9 HTML
203
9.1.2
/
CODEC
9.1.3
Internet WAV
waveform AUSparc-audio u-law
AU AIFF
MIDIMusical Instrument Digital Interface Microsoft
<bgsound> 9.1.5 Netscape
LiveAudio <embed> LiveAudio
Netscape
MIDI
MIDI
PC MIDI
MIDI 9-1
9-1
MP3MPEG level 3MP3
9-1
Internet
WAV
AU
AIFF
AIFF Mac
204
MIDI
MIDI MIDI
MIDI
PC
9.1.4 MP3
MP3 MPEGMoving Picture Experts Group
MP3 CD 10~12
MP3 .mp3
3Mb CD 30Mb
MP3 MP3
CD
CD MP3 CD
CD
MP3
MP3 MP3
9.1.5
MP3 <a>
9 HTML
205
Microsoft <bgsound>
Microsoft <bgsound>
Microsoft Internet Explorer 2 WAV MIDI <bgsound>
Webcasting
streaming RealNetworks
www.realnetworks.com RealAudio
RealAudio
streaming
28.8Kbps
2K 2K
2K
Internet
Internet Internet
TCP/IP Internet
TCP
Transmission Control Protocol
206
reservation
fee structure
Internet
28.8Kbps
drop-out
10 15
Internet
RealNetworks
RealNetworks RealAudio
Netscape ActiveX
RealNetworks RealPlayer
8 RealAudio Internet
WAV RealAudio
RealNetworks RealAudio
RealAudio
serverless
Web RealAudio
per-stream
RealAudio RealAudio
Web
9 HTML
207
RealAudio RealAudio
RealAudio
Web RealAudio RealAudio
RealProducer
RealAudio <a>
RealProducer .rm
.ram
<a href="http://www.democompany.com/audio/robotdrone.ram">
Hear our happy robots drone!</a>
RealPlayer RealPlayer
.rm 9-1 RealAudio Web
RealServer
packagemultiple stream
9-1
RealAudio RealPlayer
.ram
Synchronized Media Integration LanguageSMIL.smil
SMIL 17
RealAudio
RealAudio <object><embed><embed>
208
<embed src="http://www.democompany.com/audio/robotdrone.rpm"
nojava="true" height="100" width="250" autostart="false">
autostart
autostart="true" autostart="false"
<object>
<object id="robotdrone"
classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"
width="75" height="30">
<param name="src"
value="http://www.democompany.com/audio/robotdrone.rpm">
<param name="controls" value="PlayButton">
</object>
.rpm id
classid clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA
RealAudio <param> src
.rpm URL<param>
PlayButton IE 5.5
RealAudio RealPlayer
RealAudio
RealAudio RealNetworks
9.1.7 WindowsMedia
Microsoft
WindowsMediawww.windowsmedia.comWindowsMedia .asf
Advanced Streaming Format
Windows Media Encoder WAV
MP3 .asf RealMedia
9 HTML
209
.asx
<a href="robotdrone.asx">Hear our happy robots drone!</a>
.asx
<ASX version="3">
<Entry>
<ref href="robotdrone.asf" />
</Entry>
</ASX>
.asx WindowsMedia
WindowsMedia Player 7 Windows 98
Windows 2000 Windows 95 Windows NT
WindowsMedia
MacintoshWindowsMedia
WAV
MIDI
AU
AIFF
MP3
WindowsMedia Audio.wma
WindowsMedia CD 9.2
9.2
Internet 30
www.cnn.com
Internet
210
CODEC
/
9-2
9-2
Internet
AVI
QuickTime
MPEG
MPEG MPEG
QuickTime
CODEC QuickTime
9.2.1
AVI <a>
9 HTML
211
controls
controls
loop
1 infinite
loop="value"
9-2
212
Windows
Netscape 3 Internet Explorer AVI Macintosh
QuickTime QuickTime Internet Explorer Netscape
Windows AVI AVI
RealVideo
HTML
QuickTime
9.2.2 QuickTime
QuickTime 4 5 Apple
MIDI QuickTime Apple
PC QuickTime
CODEC CinepackIndeoMPEG CODEC
Cinepack QuickTime MPEG
QuickTime Adobe Premiere package
QuickTime
QuickTime <embed> HTML
<embed src="URL of QuickTime object"
align="top | bottom | center | baseline | left |
right | texttop | middle | absmiddle | absbottom"
autoplay="true | false"
cache="true | false"
controller="true | false"
height="pixels or percentage"
hidden
href="URL of page to load"
hspace="pixels"
loop="true | false | palindrome"
playeveryframe="true | false"
pluginspage="URL of page with plug-in information"
scale="tofit | aspect | number"
target="valid frame name"
volume="0 - 100"
vspace="pixels"
width="pixels or percentage">
9 HTML
213
cache
false
controller true false
24
height
controller
true
height width
width height
height height
0 1 height
24
height
hidden
hidden off
autoplay true
href URL controller
false href
href
autoplay
hspace <img>
loop loop true
false loop palindrome
playeveryframe
true
pluginspage
URL Netscape Internet
Explorer http://
quicktime.apple.com QuickTime
scale scale tofitaspect
1.5 scale 1 aspect
height weight
tofit height weight
214
QuickTime 9-3
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<title>QuickTime Support Under Netscape</title>
<body>
<font size="4">This example shows a frame from a promotional
clip for QuickTime, as viewed in a Netscape browser.</font>
<embed src="quicktime.mov" width="180" height="178"
autoplay="true" align="left" hspace="12" vspace="20">
</body>
</html>
9-3
Netscape QuickTime
9 HTML
215
RealVideo
RealVideo RealNetworks RealAudio RealVideo
RealPlayer RealProducer
AVIQuickTime MPEG.rm RealAudio RealVideo
RealAudio
.ram .rpm .rm
.ram .smil 9.1.6 RealAudio
SMIL 17 RealNetworks
RealVideo
WindowsMedia
Microsoft ActiveMovie
WindowsMediaWindowsMedia
WindowsMedia
AVI
MPEG
Video on DemandVOD
MP3
QuickTime .aiff.mov
WindowsMedia .wmv
Advanced Streaming Format.asf
216
9.3
Web GIF Flash Shockwave
DHTML Java
Microsoft
<marquee>
9.3.1 <marquee>
<marquee>(multimedia-like)
<marquee> hspace
vspaceheightweight HTML Microsoft
<marquee><blink><marquee>HTML
<marquee>
Internet Explorer WebTV <marquee>
</marquee>
<marquee>
Welcome to Demo Company, Inc. -- the biggest fake company in the world!
</marquee>
9 HTML
217
scrolldelay="40"
title="Silly tags arent just for Netscape anymore."
width="80%">
Welcome to Demo Company, the biggest fake company of them all!
</marquee>
</div>
</body>
</html>
9-4
behavior
alternatescroll slidebehavior
scroll direction
behavior alternate
slide
direction downleftright up
loop behavior
slideloop
scrollamount
scrollamount
scrolldelay
scrolldelay 50 scrolldelay
<marquee>
alignhspacevspaceheight weight
218
A <marquee>
<marquee> GIF
9.3.2 GIF
GIF GIF
GIF89a GIF
GIF
GIF
GIF
GIF
5
9.3.3 Flash
Macromedia Flashwww.macromedia.com/flash
Flash PhotoshopIllustrator
Freehand GIF JPEG
Bezier
curves
2 100100
Flash Flash
Flash .swf GIF GIF
Flash
9 HTML
219
.swf GIF
http://www.democompany.com/splashpage.cfm
pc CTRL Mac
SWF
Flash <embed>
<embed src="test.swf"
swLiveConnect="false"
width="320" height="240"
quality="autohigh" bgcolor="#ffffff"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/shockwave/download/
index.cgi?P1_Prod_Version=ShockwaveFlash">
<noembed>
<img src="test.gif" height="250" width="320">
</noembed>
</embed>
<noembed> Flash
GIF
<object> ActiveX
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/
flash/swflash.cab#version=4,0,2,0" width="400" height="250">
<param name="movie" value="test.swf">
<param name="quality" value="high">
<img src="test.gif" width="320" height="240">
</object>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/
flash/swflash.cab#version=4,0,2,0" width="400" height="250">
<param name=movie value="test.swf">
<param name="quality" value="high">
<embed src="test.swf" quality="high"
pluginspage="http://www.macromedia.com/shockwave/download/
index.cgi?P1_Prod_Version=ShockwaveFlash"
type="application/x-shockwave-flash" width="400"
height="250">
<noembed>
<img src="test.gif" height="250" width="320">
220
</noembed>
</embed>
</object>
9.4
Web
CSS
10
Quark
Microsoft Word
Web Word
Adobe Acrobat
Adobe Acrobat
Acrobat
Acrobat HTML
HTML 9-5
Acrobat Word
Acrobat Adobe Exchange Distiller
PDFPortable Document FormatPDF
CD-ROM Adobe
Acrobat Reader PDF Acrobat
Acrobat Reader Microsoft
Windows 3.x Windows 95Windows 98 Windows NTMacintoshLinuxSun
Microsystem Sun SPARC Solaris Sun SPARC SunOS HP-UXSilicon Graphic
IRIXIBM AIX OS/2 Digital VMS
Acrobat <a>
9 HTML
9-5
221
Acrobat
Acrobat Acrobat
Adobe www.adobe.com
9.5
Internet
MP3RealAudioRealPlayer
WindowsMedia Player MP3
222
Internet CD QuickTime
RealPlayer Windows Media Player
Flash GIF
Flash
Flash HTML
10
HTML
HTML HTML
Web HTML
Web
HTML
Flash
CSS
Cascading Style Sheets
CSS Netscape Microsoft Internet
Explorer CSS1CSS 1
CSS1
CSS2 CSS
CSS2
W3C CSS3
10.1
selector
rule<h1>
28 point
h1 {font-size: 28pt;}
<h1> Impact
h1 {font-size: 28pt;
color: red;
font-family: Impact;}
224
HTML
head
style HTML
head
head <style>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>First CSS Example</title>
<style>
h1
{font-size: 28pt;
color: red;
font-family: Impact;}
</style>
</head>
<body>
<h1>New and Improved HTML with Style</h1>
</body>
</html>
CSS HTML
10-1
10-1
CSS CSS
10
10.2
225
HTML
HTML
head
10-1
10-1
HTML
10.2.1
HTML
CSS .css
CSS1 sitestyle.css
body
{font: 10pt;
font-family: Serif;
color: black;
background-color: white;}
h1
{font: 24pt;
font-family: Sans-Serif;
color: black;
text-align: center;}
{text-indent: 0.5in;
margin-left: 50px;
margin-right: 50px;}
a:link
{color: blue; text-decoration: none;}
a:visited {color: red; text-decoration: none;}
226
type <head><meta>
<meta http-equiv="Content-Style-Type" content="text/css">
CSS type
10.2.2
HTML
HTML
HTML HTML
10
227
head <style><style></style>
HTML
HTML <!---->
{font: 24pt;
font-family: Sans-Serif;
color: black;
text-align: center;}
{text-indent: 0.5in;
margin-left: 50px;
margin-right: 50px;}
a:link
{color: blue; text-decoration: none;}
a:visited {color: red; text-decoration: none;}
a:active {color:red; text-decoration: none;}
a:hover
{color: red; text-decoration: underline;}
-->
</style>
</head>
<body>
<h1>HTML with Style</h1>
<p>Cascading Style Sheets 1 as defined by the
<a href="http://www.w3.org">W3C</a> provides
powerful page layout facilities.</p>
...Other content affected by style sheet...
</body>
</html>
cascadeCSS C
<style>
228
@import
URL<style>
{font: 24pt;
font-family: Sans-Serif;
color: black;
text-align: center;}
-->
</style>
</head>
<body>
<h1>HTML with Style</h1>
<p>Cascading Style Sheets 1 as defined by the
<a href="http://www.w3.org">W3C</a> provides
powerful page layout facilities.</p>
. . .Other content affected by style sheet. . .
</body>
</html>
corestyles.css <body><p>
linkstyles.css <a><h1>
@import
@import
Netscape 4.x<link>
10
229
10.2.3
HTML
<h1> 48 point
Arial<h1>
class style
style classidtitle HTML
HTML
<h1>
<h1 style="font-size: 48pt; font-family: Arial; color: green;">
CSS1 Inline</h1>
CSS
<h1><h1>
10.3
CSS HTML
HTML HTML
<strong>
<strong style="color: red">I am strong!</strong>
HTML
HTML
230
</body>
</html>
<div>
<span> <span>
10.4
<p>
p {line-height: 150%;}
<div><span>
HTML
<body>
body {background-color: black;}
<h1><h2> <h3>
10
231
h1
h2
h3
{font-size: 200%;}
{font-size: 150%;}
{font-size: 125%;}
10.4.1 id
<h1><h1>
class id 3 id
<h1> FirstHeading 4
CSS
#FirstHeading {background-color: green;}
id FirstHeading
id <p>
SecondParagraph
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>ID Rule Example</title>
<style type="text/css">
<!-#SecondParagraph {background-color: green;}
-->
</style>
</head>
<body>
<p>This is the first paragraph.</p>
<p id="SecondParagraph">This is the second paragraph</p>
<p>This is the third paragraph. </p>
</body>
</html>
232
HTML 4 id <html><head><body>
HTML HTML
id id="secondparagraph"
?
class
10.4.2 class
class classclass
class
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Class Example</title>
<style type="text/css">
<!-.veryimportant {background-color: yellow;}
-->
</style>
</head>
<body>
<h1 class="veryimportant">Example</h1>
<p class="veryimportant">This is the first paragraph.</p>
<p>This is the second paragraph</p>
<p class="veryimportant">This is the third paragraph.</p>
</body>
</html>
3 class veryimportant
veryimportant class
class
.main-item {font-size: 150%;}
10.4.3
pseudo-classes CSS1
HTML
10
233
CSS
pseudo-elementsCSS1
:first-letter :first-line <p>
234
10-2
CSS
10-2
10.4.4
class id
<p><strong>
contextual selection
<p><strong><strong>
10.4.5
HTML <html><html>
<head><body><title><p>
10-3
10
235
10-3
<b> <p><p>
<body><body><html><p>
p {color: red;}
<b> color
border
p {border: solid;}
<b> border
border
CSS B CSS1
p
b
236
<b> 14
color <b> color
CSS Ccascade
id <p>
class class <p>
style
!important
!important
p {color: red !important; font-size: 12pt;}
!important
font-size !important
10.5
10
237
<style type="text/css">
<!-body
{background-color: black;}
div.page {background-color: #FFD040;
color: black;
margin: 50px 10px 50px 10px;
padding: 10px 10px;
width: 90%;
height: 90%;}
h1
{font-size: 24pt;
font-family: Comic Sans Ms, Cursive;
text-align: center;}
.blackonwhite {color: black; background-color: white;}
.whiteonblack {color: white; background-color: black;}
p
{font-family: Arial, Sans-serif;
font-size: 16pt;
line-height: 200%;
text-align: justify;
text-indent: 20px;}
.style
{color: blue; font-family: Arial; font-style: oblique;}
.size
{font-size: x-large;}
#letterspace {letter-spacing: 15pt;}
-->
</style>
</head>
<body>
<div class="page">
<h1><span class="blackonwhite">CSS</span>
<span class="whiteonblack">Fun</span>
</h1>
<hr>
<p> With style sheets, you will be able to control the presentation
of Web pages with greater precision. Style sheets can be used to
set everything from <span class="style">font styles</span> and
<span class="size">sizes</span> to <span id="letterspace">letter
spacing</span> and line heights.
</p>
</div>
</body>
</html>
238
10-4
CSS
10.6
CSS1
10.1
CSS1 50
CSS1 HTML
10
239
CSS
10.6.1 CSS
CSS1
CSS1 cmmm
(in)
4 id text-indent
#para1
#para2
#para3
#para4
{text-indent:
{text-indent:
{text-indent:
{text-indent:
1in;}
10mm;}
0.5cm;}
-0.75cm;}
CSS
pointpt pica 1
10 pc
72 1 1 pica
12 1 6 pica
P.big
.verysmall
#picameasure
{font-size: 64pt;}
{font-size: 6pt;}
{line-height: 2pc;}
point
Web 12 PC Macintosh
PC
(px)
.bypixel
{font-size: 40px;}
em-height emx-height ex
%
em
12ptem 12pt
2em 24pt
<div style="font-size: 12pt; text-indent: 1em;">Em example with
font-size at 12pt.</div>
<div style="font-size: 24pt; text-indent: 1em;">Same example with
font-size at 24pt.</div>
240
2 em 1 2
em
em x-height ex
x
x-height x-height
x-height ex x-height
p {line-height: 2.5ex;}
em
b {font-size: 80%;} /* 80% of the parent elements font */
point
pixel
10.7
Font
CSS1 Web
font color
background margin spacing
10.7.1 font-family
font-family font-family
Arial sans serif
Britannic Bold
10
241
CSS1 CSS1
Serif ( Times)
Sans-serif ( Helvetica)
Cursive ( Zapf-Chancery)
Fantasy ( Western)
Monospace ( Courier)
<font> font-family
font-family CSS1
<body>
body
font-family CSS1
10.7.2 font-size
font-size
xx-smallx-smallsmallmediumlargex-large
xx-large larger smaller 48pt2cm .25in
150%
point
p
font-size: 18pt;}
strong {font-size: larger;}
.double {font-size: 200%;}
font-size point
10 point
point
10.7.3 font-style
font-style normalitalic oblique italic
oblique
italic oblique normal
Roman
h1
.firstuse
em
{font-style: oblique;}
{font-style: italic;}
{font-style: normal;}
242
10.7.4 font-weight
font-weight 100900 100
normalboldbolder lighter
extra-lightlightdemi-lightmediumdemi-boldbold
extra-bold 100~900
.important
h1
P.special
{font-weight: bolder;}
{font-weight: 900;}
{font-weight: extra-bold;}
bold 700
normal 400
bold normal font-weight
10.7.5 font-variant
font-variant
small-caps normal small-caps
normal Internet Explorer 5 Netscape
6
em
{font-variant: small-caps;}
10.7.6 font
font font
line-height
line-height font-size
10
.serif
.sans-serif
.cursive
.fantasy
.comic
.xx-small
.x-small
.small
.medium
.large
.x-large
.xx-large
.smaller
.larger
.points
.percentage
.italic
.oblique
.weight
.smallcaps
-->
</style>
</head>
<body>
{font-family: serif;}
{font-family: sans-serif;}
{font-family: cursive;}
{font-family: fantasy;}
{font-family: Comic Sans MS;}
{font-size: xx-small;}
{font-size: x-small;}
{font-size: small;}
{font-size: medium;}
{font-size: large;}
{font-size: x-large;}
{font-size: xx-large;}
{font-size: smaller;}
{font-size: larger;}
{font-size: 18pt;}
{font-size: 200%;}
{font-style: italic;}
{font-style: oblique;}
{font-weight: 900;}
{font-variant: small-caps;}
<h2>Font Family</h2>
This text is in <span class="serif">Serif.</span><br>
This text is in <span class="sans-serif">Sans-Serif.</span><br>
This text is in <span class="cursive">Cursive.</span><br>
This text is in <span class="fantasy">Fantasy.</span><br>
Actual fonts can be specified like <span class="comic">
Comic Sans MS</span><br>
<h2>Font Sizing</h2>
This is <span class="xx-small">xx-small text.</span><br>
This is <span class="x-small">x-small text.</span><br>
This is <span class="small">small text.</span><br>
This is <span class="medium">medium text.</span><br>
This is <span class="large">large text.</span><br>
This is <span class="x-large">x-large text.</span><br>
This is <span class="xx-large">xx-large text.</span><br>
This is <span class="smaller">smaller text</span> than the rest.
<br>
This is <span class="larger">larger text</span> than the rest.<br>
This is <span class="points">exactly 18 point text.</span><br>
This is <span class="percentage">200% larger text.</span><br>
<h2>Font Style, Weight, and Variant</h2>
This text is <span class="italic">italic.</span><br>
This text is <span class="oblique">oblique.</span><br>
243
244
10-5
10-5
10.8
Text
Text Text
CSS
text-transform
10.8.1 text-transform
text-transform capitalize
10
245
{text-transform: capitalize;}
{text-transform: uppercase;}
{text-transform: lower;}
10.8.2 text-decoration
text-decoration line-through
overlineunderline none overline
overline Netscape blink
.struck
span.special
h1
a
#author
{text-decoration: line-through;}
{text-decoration: blink;}
{text-decoration: overline;}
{text-decoration: none;}
{text-decoration: underline;}
10.8.3 word-spacing
word-spacing normal
in
cm
mmpointptpicapc
emem
px
body
p
{word-spacing: 10pt;}
{font-size: 18pt; word-spacing: 1em;}
10.8.4 letter-spacing
letter-spacing normal
word-spacing
em
p
body
.wide
#Fun
{letter-spacing: 0.2em;}
{letter-spacing: 2px;}
{letter-spacing: 10pt;}
{letter-spacing: 2cm;}
246
10.8.5 vertical-align
vertical-align
baselinesubsupertoptext-topmiddlebottomtext-bottom
<img> align
vertical-align baseline
p
.superscript
.subscript
{vertical-align: text-top;}
{vertical-align: super; font-size: smaller;}
{vertical-align: sub; font-size: 75%;}
vertical-align
.superscript
10.8.6 text-align
text-align <p>
leftrightcenter justify left<p>
HTML align justify
p
div
.goright
{text-align: justify;}
{text-align: center;}
{text-align: right;}
10.8.7 text-indent
text-indent <p>
.5cm15px 12pt 10%
0 text-indent
p
{text-indent: 2em;}
p.heavy {text-indent: 150px;}
:first-letter
10.8.8 line-height
line-height
10
247
1.4 14pt
200%
p.double
{line-height: 2;}
p.double2
{line-height: 200%;}
line-height
p
p.carson
line-height font-size
10.8.9 white-space
white-space Tab
normal HTML
pre <pre> HTML
nowrap
white-space <pre>
p.pre {white-space:pre;}
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>CSS Text Attributes Example</title>
<style type="text/css">
<!
/* letter and word spacing */
.letterspaced {letter-spacing: 10pt;}
.wordspaced
{word-spacing: 20px;}
/* vertical alignment examples */
.sub
{vertical-align: sub;}
.super
{vertical-align: super;}
/* text alignment properties */
.right
{text-align: right;}
.left
{text-align: left;}
.justify
{text-align: justify;}
.center
{text-align: center;}
/* indentation and line-height examples */
248
p.indent
{text-indent: 20px;
line-height: 200%;}
p.negindent
{text-indent: -10px;
background-color: yellow;}
#bigchar
{background-color: red;
color: white;
font-size: 28pt;
font-family: Impact;}
p.carson
{font-size: 12pt;
font-family: Courier;
letter-spacing: 4pt;
line-height: 5pt;}
{text-transform: uppercase;}
{text-transform: lowercase;}
{text-transform: capitalize;}
/* text-decoration properties */
.underline
{text-decoration: underline;}
.blink
{text-decoration: blink;}
.line-through {text-decoration: line-through;}
.overline
{text-decoration: overline;}
/* white space control */
.normal
{white-space: normal;}
.pre
{white-space: pre;}
.nowrap
{white-space: nowrap;}
-->
</style>
</head>
<body>
<h2>Letter Spacing and Vertical Alignment</h2>
<p>This is a paragraph of text.
<span class="letterspaced">Spacing letters is possible</span>
and so <span class="wordspaced">should word spacing.
Alas, it not always supported!</span></p>
<p>Vertical alignment can be used to make
<span class="sub">Subscript</span> and
<span class="super">Superscript</span> text, but the
real use of the property is for aligning text next to images.</p>
<h2>Alignment</h2>
<p class="left">Align a paragraph to the left as normal.</p>
<p class="right">Align paragraphs to the right as we did in
HTML</p>
<p class="justify">You can even set the justification of text so
10
249
that it is aligned on both the left and the right side. You need
to be careful with this so that you dont get rivers of white space
running through your paragraphs.</p>
<p class="center">Text can of course also be centered.</span>
<h2>Indentation and Line Height</h2>
<p class="indent">With style sheets it is possible to set
indentation as well as line height. Now double spacing is a
reality. This is just dummy text to show the effects of the
indentation and spacing. This is just dummy text to show the
effects of the indentation and spacing.</p>
<p class="negindent"><span id="bigchar">T</span>his is another
paragraph which has negative indenting. Notice how you can pull
a character outside the paragraph for interesting effects. This
is just dummy text to show the effect of the indent. This is
just dummy text to show the effect of the indent.</p>
<h2>Surf Gun</h2>
<p class="carson">Dont get carried away with your newfound
powers. You may be tempted to show how cool you can be using
text on top of other text. While this may be good for certain
situations, it may also confuse the viewer.</p>
<h2>Text Transformation</h2>
The next bit of text is transformed <span class="uppercase">to all
uppercase.</span><br> The next bit of text is transformed
<span class="lowercase">to all lowercase.</span><br>
<span class="capitalize">This text is all capitalized. It doesnt
do what you think, does it?</span><br>
<h2>Text Decoration</h2>
This text
<br><br>
This text
<br><br>
This text
<br><br>
This text
<br><br>
spacing</p>
250
</body>
</html>
10-6
10-6
Netscape 6
10
10.9
251
List
3 HTML
HTML
CSS1
list-style-type
list-style-image
list-style-position list-style
10.9.1 list-style-type
CSS1 list-style-type
decimallower-romanupper-romanlower-alphaupper-alpha
nonedisccirclesquare none none
HTML type
<ol type="i">
ol
{list-style-type: upper-roman;}
<ul type="square">
ul
{list-style-type: square;}
ol
ol ol
ol ol ol
{list-style-type: upper-roman;}
{list-style-type: lower-roman;}
{list-style-type: lower-alpha;}
list-style-type <li>
id
10.9.2 list-style-image
list-style-type HTML list-style-image
HTML URL
none
UL
{list-style-image: url("flag.gif")}
url
URL URL
252
10.9.3 list-style-position
CSS
list-style-position
inside outside
outside
ul.compact {list-style-position: inside;}
10.9.4 list-style
marginpadding list-style
bullet.gif
list 10-7
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>List Properties Example</title>
<style type="text/css">
<!-ul {list-style-image: url("flag.gif");}
.inside {list-style-type: upper-roman;
background-color: yellow;
list-style-position: inside;}
.outside {background-color: yellow;
list-style-position: inside;}
-->
</style>
</head>
<body>
<ul>
<li>Item a</li>
<li>Item b</li>
</ul>
<ol class="outside">
<li>Item a</li>
<li>Item b</li>
</ol>
<ol class="inside">
<li>Item a</li>
10
253
<li>Item b</li>
</ol>
</body>
</html>
10-7
10.10
Color Background
CSS1
HTML
CSS1 3
16 Windows VGA
AquaBlackBlueFuchsiaGrayGreenLimeMaroon
NavyOlivePurpleRedSilverTealWhite Yellow HTML
6 #RRGGBB
<font><body>3 #RGB
CSS1 #F00 3
254
{color:
{color:
{color:
{color:
green;}
#FF0088;}
#0f0;}
rgb(0,255,0);}
10.10.2 background-color
background-color none
transparent background-color
color background-color
marginbackground-color
color
p
body
.fun
#test
{background-color: yellow;}
{background-color: #0000FF;}
{background-color: #F00;}
{background-color: rgb(0,0,0);}
10.10.3 background-image
background-image
background-image
background-color
background-image URL
<body> background GIF
JPEG background-color
b
{background-image: url(donut-tile.gif);
background-color: white;}
body
{background-image: url(funtile.gif);}
.brick {background-image: url(brick.gif);}
#prison {background-image: url(bars.gif);}
<b><body>
10.10.4 background-repeat
background-repeat canvas
repeat
10
255
repeat-x repeat-y
no-repeat
p
{background-image: url(donut-tile.gif);
background-repeat: repeat-x;}
.tileup {background-image: url(tile.gif);
background-repeat: repeat-y;}
body
{background-image: url(tile.gif);
background-repeat: no-repeat;}
2
background-attachment
10.10.5 background-attachment
background-attachment
scroll fixed
<body> bgproperties Microsoft
body {background-image:url(logo.gif);background-attachment:
fixed;}
10.10.6 background-position
background-position
leftcenter
right topcenter bottom
center
10
p {background-image:url(picture.gif);background-position: 10px
10px;}
<body>
256
p
{background-image:url(picture.gif);background-position: 20%
40%;}
50%
top left
top center
top right
center left
center center
center right
bottom left
bottom center
bottom right
0%
50%
100%
0%
50%
100%
0%
50%
100%
0%
0%
0%
50%
50%
50%
100%
100%
100%
body
{background-image: url(picture.gif);
background-position: center center;}
center
center
10.10.7 background
background
font
p
{background: white url(picture.gif) repeat-y center;}
body
{background: url(tile.jpg) top center fixed;}
.bricks {background: repeat-y top top url(bricks.gif);}
CSS
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>CSS Background Attributes Example</title>
<style type="text/css">
<!-body {background-color: green;}
p
{background: yellow url(flag.gif) repeat-y fixed 100px;}
.red {background-color: red;}
-->
</style>
</head>
10
257
<body>
<p>This is a paragraph of text. The left side will probably be hard
to read because it is on top of an image that repeats along the
y-axis. Notice that the area not covered by the background image is
filled with the background color. <span class="red">Backgrounds
anywhere!
</span>
This is more text just to illustrate the idea. This is even more text.
This is more text just to illustrate the idea. This is even more text.
This is more text just to illustrate the idea. This is even more text.
This is more text just to illustrate the idea. This is even more text.
This is more text just to illustrate the idea. This is even more
text.</p>
</body>
</html>
HTML
<table> 10-8
10-8
background
10.11
Box
<p>
box
margin box
border border
padding
height, width positioning box
258
auto
Body
margin
margin
14
{margin: 1.5cm;}
4 1.5 cm
10 5
15 5 2 3
10 5
10 5
margin
10
<title>CSS Margin Example</title>
<style type="text/css">
<!-#one
{background-color: yellow;
margin: 1cm 1cm;}
#two
{background-color: orange;
margin-top: 1cm;
margin-bottom: 1cm;
margin-right: .5cm;
margin-left: -10px;}
10-9
259
260
10.11.2 border
bordermargin
paddingborder
border
border-style
border-style none
border-style
dotted
dashed
solid
double
groove
ridge
inset
outset
border-style
h1
{border-style: solid;}
p.boxed {border-style: double;}
.button {border-style: outset;}
border-style
border-top-styleborder-bottom-styleborder-left-style border-right-style border-style
margin 4
p
p.one
p.two
border-width
4
border-top-widthborder-right-widthborder-bottom-width border-left-width border-style
border-width 4 14
10
261
2 3 margin
border-style thinmedium
thick 10
p
p.double
p.thickandthin
.fun
{border-style:
{border-style:
{border-style:
{border-style:
border-color
border-color
RGB border-color 4
1 4
2 3 border-width
border-style border-top-colorborder-right-colorborder-bottom-color
border-left-color
p
p.all
border
border 1
border-topborder-rightborder-bottom border-left 4
4
double-line 20
p {border-top: double 20px red;}
border
double-line 20
262
border-top border-top-style
border
{background-color: yellow;
border-style: double;
border-width: medium;}
#two
{background-color: yellow;
border-style: double solid;
border-color: red green purple blue;
border-width: thin medium thick .25cm;}
-->
</style>
</head>
<body>
<div id="outer">
<p id="one">This is a paragraph of text which has a
red double border around it. Notice how the text
creeps up on the edges. Padding values will help you
avoid this problem.</p>
<p id="two">This is another paragraph which has its
borders set in a very bizarre way!</p>
Notice that the paragraph blocks can be within a large
boxed block structure.
</div>
</body>
</html>
10
10-10
263
CSS border
10.11.3 padding
padding 4
padding padding-toppadding-rightpadding-bottom padding-left
bordermargin padding
padding padding
padding 4 1 4
4
2 3
div
solid 1
p
2 4