Tải bản đầy đủ (.pdf) (20 trang)

Tài liệu Web Programming with HTML, XHTML, and CSS Second Edition- P16 pdf

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (242.1 KB, 20 trang )

information provided, 381
layout, 387–397
listing required information, 380–381
paper forms and, 381
home pages, 345
influence of images on, 341
links
images as, 375
text links, 375
navigation, 342–343
bottom, 344
left, 343
menus, 369–374
right, 345
top, 343
top and left, 344
site searches
Google, 376–378
usability and, 376
sketching element placement, 337–339
structuring pages, 346–347
sacrificial columns, 354–355
single-column layout, 348–350
three-column layouts, 353–354
two-column layouts, 350–352
style, 339–342
tables, shading multiple rows, 378–379
text
alignment, 365
background images, 366–367
column width, 366


fonts, 367–368
line height, 365–366
white space and, 362–364
wireframe model, 338
<dfn> element, 32, 573
digit (d), 463
dimensions, properties, CSS, 619–621
dir attribute, 14, 115, 564
<bdo> element, 568
<head> element, 578
<hr /> element, 579
<html> element, 579
<isindex> element, 588
<meta> element, 593
<title> element, 605
<dir> element, 574, 701–702
direction attribute, <marquee> element, 592
directories, 57
directory structures, 57, 509
disabled attribute
<button> element, 571
<input type="button"> element, 582
<input type="checkbox"> element, 582
<input type="file"> element, 583
<input type="image"> element, 584
<input type="password"> element, 585
<input type="radio"> element, 586
<input type="reset"> element, 586
<input type="submit"> element, 587
<input type="text"> element, 587

<optgroup> element, 596
<option> element, 597
<select> element, 598
disabled controls, 176–177
discussion boards, 530
display property, 302
dithering, 80
<div> element, 49–50, 489
attributes, 574
liquid designs, 334
division (/) operator, 425
<dl> element, 39–40, 574
do while loops, 433, 434
DOCTYPE, 8–9, 187
document property, 448
document type declaration, 8–9
documents
linking to, 54–56
structure, 3
DOM (document object model), 405
alinkColor property, 413
bgcolor property, 413
collections, 410–411, 415–416
fgcolor property, 413
introduction, 410–412
lastModified property, 413
linkColor property, 413
methods and, 410
properties and, 410
referrer property, 413

scriptable objects, 410
title property, 413
vlinkColor property, 413
write method, 414
writeln method, 414
domain name, obtaining, 517–518
dot notation, 411
721
dot notation
Index
59313bindex.qxd:WroxPro 3/23/08 3:08 PM Page 721
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
dots per inch, 79
drag-and-drop, Scriptaculous, 490–492
drop-down navigation menus, 497
<dt> element, 574
dynsrc attribute, <img> element, 581
E
e-mail
addresses
hiding, 497
testing for, 465
forms example, 477–482
linking to addresses, 56–57
E property, 444
editing, text, inserting, 46
editing text, deleting, 46–47
elements, 4
<a>, 6, 65
<abbr>, 31, 565

<acronym>, 31, 565
<address>, 35, 565
<applet>, 566, 704–705
<area>, 567
basefont>, 565
attributes, 6–7
<b>, 26, 568
<base>, 64–65, 568
<basefont>, 686–687
<bdo>, 568
<bgsound>, 569
<big>, 28, 569
<blink>, 569
block elements, 48–49
<blockquote>, 32, 569
<body>, 5, 11, 569–570
<br>, 21–22
<br />, 570
<button>, 153, 570
<caption>, 571
<center>, 571, 691–697
child, 5
<cite>, 33–34, 572
<code>, 34, 572
<col>, 572
<colgroup>, 130–132, 572–573
<comment>, 573
<dd>, 573
<del>, 46–47, 573
<dfn>, 32, 573

<dir>, 574, 701–702
<div>, 49–50, 574
<dl>, 39–40, 574
<dt>, 574
<em>, 30, 574
<embed>, 575, 705–706
empty elements, 21
<fieldset>, 171–173, 575
<font>, 48, 576, 683–685
<form>, 140, 576
<frame>, 195–197, 576–577
<frameset>, 186, 577–578
grouping, 49–50
<head>, 5, 10–11, 578
<hn>, 578
<hr />, 28, 579
<html>, 9–10, 579–580
<i>, 26–27, 580
IE-specific, 707–708
<iframe>, 580
<img>, 86, 580–582
inline elements, 48–49
<input type="button">, 582
<input type="checkbox">, 582–583
<input type="file”>, 583
<input type=”hidden”>, 584
<input type=”image”>, 584
<input type=”password”>, 585
<input type=”radio”>, 585–586
<input type=”reset”>, 586

<input type=”submit”>, 587
<input type=”text”>, 587–588
<ins>, 46, 588
inside another, 6
<isindex>, 588–589, 706–707
<kbd>, 34–35, 589
<keygen>, 589
<label>, 169–171, 589
<layer>, 589
<legend>, 171–173, 590
<li>, 574, 591, 593
<link>, 591
<listing>, 591, 688–689
<map>, 592
<marquee>, 592
<menu>, 593, 701–702
<meta>, 502, 593
<multicol>, 593
nesting, 6
Netscape-specific, 712
722
dots per inch
59313bindex.qxd:WroxPro 3/23/08 3:08 PM Page 722
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
<nextid>, 594
<nobr>, 594
<noembed>, 594
<noframes>, 186, 197–198, 577, 594
<nolayer>, 594
<noscript>, 408, 594

<object>, 93–94, 594
<ol>, 37–39, 596
<optgroup>, 596
<option>, 159, 597
<p>, 21, 597
<param>, 97–98, 567, 596, 597
parent, 5
<plaintext>, 597, 688–689
<pre>, 22–23, 597
<q>, 33, 598
<s>, 27, 598, 687
<samp>, 35, 598
<script>, 406, 598
<select>, 158–159, 598–599
<small>, 28, 599
<span>, 49–50, 599
<strike>, 27, 599, 687
<strong>, 30, 599
<style>, 599
<sub>, 28, 599
<sup>, 28, 599
<table>, 109, 600–601
tags, 4
comparison, 5
<tbody>, 126, 601
<td>, 601–602
<textarea>, 602–603
<tfoot>, 126, 603
<th>, 110, 604
<thead>, 126, 603

<title>, 11, 605
<tr>, 605
<tt>, 27, 606
<u>, 27, 606, 687–688
<ul>, 36–37, 606
<var>, 35, 606
<wbr>, 606
<xmp>, 606, 688–689
<em> element, 30, 574
em units, 250
<embed> element, 575, 705–706
emphasis, 30
empty-cells property, 292–294
empty elements, 21
enctype attribute, <form> element, 576
equal to (==) operator, 426
escaping characters, 463
events
common events, 16
intrinsic, 435
onblur, 437
onchange, 437
ondblclick, 436
onfocus, 437
onkeydown, 436
onkeypress, 436
onkeyup, 436
onload, 436
onmousedown, 436
onmousemove, 436

onmouseout, 436
onmouseover, 436
onmouseup, 436
onreset, 437
onselect, 437
onsubmit, 437
onunload, 436
triggering, 407
UI events, 16
user events, 435
window events, 435
ex units, 250
exp( ) method, 445
expiring web pages, 505
explicit labels, 387
expressions, 414
external JavaScript, 409
F
face attribute, 568, 576
Fetch, 521
fgcolor property (DOM), 413
fields (forms)
auto-tabbing, 471–472
trimming spaces from beginning and end,
474–475
<fieldset> element, 171–173, 385, 575
file, size, 84–85
file select boxes, 164–165
filepath, 60
FireFTP, 521

first-letter pseudo class, 239–240
fixed( ) method, 438
723
fixed( ) method
Index
59313bindex.qxd:WroxPro 3/23/08 3:08 PM Page 723
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
fixed positioning, 310–311
fixed-size fonts, screen resolution and, 369
fixed-width designs, 331, 335–336
Flash, 98–99, 535–536
Flash Player, files, 85
float property, 312–314
floating frames, 204–205
floor( ) method, 445, 485
flow, 17–18, 306
focus
first form item, 470–471
<input> element, 296
tabbing order, 173–174
focus( ) method, 417, 449, 471–472, 475–476
:focus pseudo class, 296
folders, directory structure, 57
<font> element, 48, 576, 683–685
font-family property, 368
font test page, 240–243
fontcolor( ) method, 438
fonts
CSS properties, 607–611
fixed-size, screen resolution and, 369

font-family property, 368
sans-serif, 367
serifs, 367
fontsize( ) method, 438
for attribute, <label> element, 589
for loops, 433, 434–435
<form> element, 140
attributes, 142–145, 576
creating forms, 141–145
methods, 417
onsubmit event handler, 454
properties, 416
white space and, 145
form-feed (f), 463
formatting
align attribute, 692–693
<center> element, 691–697
text, 23–26
forms
buttons, 150–152, 394
case conversion, 474
checkboxes, 154–155, 476–477
collecting data, 417–419
color, 395–396
controls, 139, 382
checkboxes, 383
<fieldset> elements, 385
grouping, 384–387
hidden, 165–166
labelling, 387–389

radio buttons, 383
relevant information and, 391–393
select boxes, 384
text boxes, 384
text inputs, 145–150
title attribute, 394–395
CSS and, 396–397
designing
form controls, 382–384
group-related information, 381
information provided, 381
layout, 387–397
listing required information, 380–381
paper forms and, 381
e-mail example, 477–482
fields
auto-tabbing, 471–472
trimming spaces from beginning and end,
474–475
file select boxes, 164–165
focus, first item, 470–471
introduction, 140–141
<legend> element, 385
name/value pairs, 141
numbering questions, 387
radio buttons, 156–157
registration form example, 166–169, 180–182
required information, 393
select boxes, 158–163
sending data to server, 178–179

site registration form example, 397–401
splitting into separate pages, 386
submission, preventing until checkbox selection,
469–470
submit button, 140
tab order of elements, 395
tables and, 389–391
testing, 397
text, 472–474
text area, selecting all content, 475–476
validation
checkboxes, 468–469
checking text fields, 457–459
finding characters, 462–464
how, 456
preventing submission until checkbox selection,
469–470
724
fixed positioning
59313bindex.qxd:WroxPro 3/23/08 3:08 PM Page 724
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
radio buttons, 467–468
required text fields, 459–461
select box options, 464–465
testing characters, 464–465
when, 456
forms collection (DOM), 410–411, 415
forums, 530
forward( ) method, 449
forward slashes, 462

fragment identifiers, 61
framborder attribute, <frame> element, 577
frame attribute, 115–116
<table> element, 600
frame-based book viewer, 201–204
<frame> element, 194–195
attributes, 576–577
frameborder attribute, 193
<frame> element, 195
<frameset> element, 578
<iframe> element, 207, 580
frames, 185
DOCTYPE and, 187
floating, 204–205
inline, 204–205, 207–209
links between, 198–200
when to use, 188–189
frames property, 448
frameset, columns, 189–191
<frameset> element, 186
attributes, 189–194, 577–578
extensions, browser-specific, 192–194
Frameset XHTML, 8
framesets, 185, 200
framespacing attribute, 194, 578
FTP (File Transfer Protocol), uploading site and,
520–522
FTPX, 521
functions, 422
calling, 428

defining, 428
JavaScript, 407
return statements, 429
G
generated content
:after pseudo-element, 297–298
:before pseudo-element, 297–298
content property, 298
getDate( ) method, 442
getDay( ) method, 442
getFullYear( ) method, 442
getHours( ) method, 442
getMinutes( ) method, 442
getMonth( ) method, 442
getSeconds( ) method, 442
getTime( ) method, 442
getTimezoneOffset( ) method, 442
getUTCDate( ) method, 443
getUTCDay( ) method, 443
getUTCFullYear( ) method, 443
getUTCHours( ) method, 443
getUTCMilliseconds( ) method, 443
getUTCMinutes( ) method, 443
getUTCMonth( ) method, 443
getUTCSeconds( ) method, 443
getYear( ) method, 442
GIF (Graphics Interchange Format), 79–82
graphics, 77–79
graphics packages, 536
greater than (>) operator, 426

greater than or equal to (>=) operator, 426
grids, 109
grouping elements, 49–50
gutter attribute, <multicol> element, 593
H
handleOther( ) function, 473
<head> element, 5, 10–11
attributes, 578
meta tags, 502
headers attribute, 602, 604
headings, 18–21
height attribute, 88–89, 96
<embed> element, 575
<iframe> element, 206, 580
<img> element, 581
<marquee> element, 592
<table> element, 600
<td> element, 602
<th> element, 604
height property, 419
hexadecimal codes, 638–639
color, 637–638
color names and, 640–641
color reference, 641–644
hidden attribute, <embed> element, 575
hidden controls, 165–166
history property, 448
725
history property
Index

59313bindex.qxd:WroxPro 3/23/08 3:08 PM Page 725
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
<hn> elements, 18–19, 578
home( ) method, 449
home pages, designing, 345
host address, 60
hosting, 518
backups, 519
bandwidth, 519
choosing host, 519–520
country, 519
data centers, 519
dedicated, 520
disk space, 519
e-mail accounts, 519
shared, 520
statistical analysis, 526–527
statistics packages, 520
uptime, 520
hosting company, 501
<hr /> element, 28, 579
href attribute, 7
<a> element, 565
<area> element, 567
<base> element, 568
<link> element, 591
linking to documents, 54–56
hreflang attribute, 69, 565, 591
hspace attribute, 90, 96, 696–697
<embed> element, 575

<img> element, 581
<marquee> element, 592
<table> element, 600
hspace property, 419
<html> element, 9–10, 579–580
HTML (Hypertext Markup Language), 2
HTML validation, 509–512
http-equiv attribute, <meta> element, 593
HTTP headers, 505
HTTP (Hypertext Transfer Protocol), 59
hyperlinks. See links
I
<i> element, 26–27, 580
id attribute, 12–13, 564
<base> element, 568
<br /> element, 570
<comment> element, 573
<frame> element, 577
<head> element, 578
<hr /> element, 579
<html> element, 579
<isindex> element, 588
<keygen> element, 589
<marquee> element, 592
<param> element, 596
<title> element, 605
id selector, 244
if statements, 429–430
if...else statements, 430
<iframe> element, 204–207, 580

image maps, 77, 100–105
image rollovers, 420–421, 482–483
images, 77
adding to documents, 92–93
background, text readability and, 366–367
background-image property, 277–278
bitmap, 78–79
as buttons, 152–153
formats, 78
GIF, 79
<img> element, 86
JPEG, 79
as links, 99–100, 375
list-style-image property, 286
PNG, 79
images collection (DOM), 410, 419–420
<img> element, 86–91, 581
implicit labels, 387
@import rule, 304–305
!important rule, 305
importing, styles, 304–305
increment (++) operator, 425
indexed color format, 79
indexOf( ) method, 438
infininte loops, 435
inline elements, 48–49
inline frames, 204–205, 207–209
input, forms, 145–150
text, disabling, 472–474
<input> element, 150–152, 296

<input type=”button”> element, attributes, 582
<input type=”checkbox”> element, attributes,
582–583
<input type=”file”> element, attributes, 583
<input type=”hidden”> element, attributes, 584
<input type=”image”> element, attributes, 584
<input type=”password”> element, attributes, 585
<input type=”radio”> element, attributes, 586
726
<hn> elements
59313bindex.qxd:WroxPro 3/23/08 3:08 PM Page 726
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
<input type=”reset”> element, attributes, 586
<input type=”submit”> element, attributes, 587
<input type=”text”> element, attributes,
587–588
<ins> element, 46, 588
inserting text, 46
internationalization attributes, 14–15
internationalization properties, 634–635
intrinsic events, 435
<isindex> element, 588–589, 706–707
ismap attribute, 90, 581
italic text, 26–27
italics( ) method, 439
J
JavaScript
breaking up code lines, 450
case-sensitivity, 449
comments, 408

conditional statements, 423
data types, 450–451
external, 409
files, external, 455
functions, 407, 422
keywords, 451
libraries, 487–488
animation, 488–490
auto-completing text, 495–496
calendars, 494–495
drag-and-drop, 490–492
sortable tables, 492–493
loops, 423
opening and closing symbols, 450
operators, 422, 424–425
arithmetic, 425
assignment, 425–426
Boolean, 427
comparison, 426
logical, 427
string, 427
scripts
adding to pages, 406–408
folder, 455
special characters, 450
variables, 422
assigning values, 424
declaring, 423
lifetime, 424
rules, 423–424

when not to use, 496–497
write( ) method, 406
join( ) method, 447
JPEG (Joint Photographic Experts Group
Format), 79
compression and, 82
K
<kbd> element, 34–35, 589
keyboard, <kbd> element, 34–35
<keygen> element, attributes, 589
keywords
JavaScript, 451
mailto, 56
L
label attribute, 596, 597
<label> element, 169–171, 589
labels, controls, 169–171
Lang attribute, <comment> element, 573
lang attribute, 14–15, 564
<frame> element, 577
<head> element, 578
<html> element, 579
<isindex> element, 588
<meta> element, 593
<title> element, 605
language attribute, 598, 704
language codes, 665–668
lastIndexOf( ) method, 439
lastModified property (DOM), 413
<layer> element, attributes, 590

leading, 365
left attribute, <layer> element, 590
left navigation, 343
leftmargin attribute, <body> element, 570
<legend> element, 171–173, 385, 590
length property, 438, 458
lengths, CSS properties, 635
less than (<) operator, 426
less than or equal to (<=) operator, 426
<li> element, attributes, 574, 591, 593
libraries, JavaScript, 487–488
animation, 488–490
auto-completing text, 495–496
calendars, 494–495
drag-and-drop, 490–492
sortable tables, 492–493
727
libraries
Index
59313bindex.qxd:WroxPro 3/23/08 3:08 PM Page 727
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
line breaks, 21–22
line height, readability and, 365–366
linefeed (n), 463
link( ) method, 439
link attribute, <body> element, 570
<link> element
attributes, 591
CSS, 218–219
<head> element, 10

Link Valet tool, 513–514
linkColor property (DOM), 413
links, 53, 698–699
<a> element, 65
checking, 513–514
color, 274
CSS, 274–275
default files, 63
e-mail, 74–75
to e-mail addresses, 56–57
between frames, 198–200
images as, 99–100, 375
to other documents, 54–56
within pages, 71–74
parent directory, 63
from root, 63
same directory, 62
subdirectory, 62–63
text links, 375
links collection (DOM), 411
liquid designs, 331, 333–335
list-style-position property, 285–286
list-style property, 286
list-style-type property, 284–285
<listing> element, 591, 688–689
lists
CSS properties, 623–625
definition, 39–40
list-style-image property, 286
list-style-position property, 285–286

list-style property, 286
list-style-type property, 284–285
marker-offset property, 287
nesting, 40–41
ordered, 37–39
start attribute, 699
type attribute, 700–701
unordered, 36–37
value attribute, 700
LN2 property, 444
LN10 property, 444
location property, 448
log( ) method, 445
LOG2E property, 445
LOG10E property, 445
logical operators, 427
longdesc attribute, 90–91
<frame> element, 197, 577
<iframe> element, 207, 580
<img> element, 581
loop attribute
<bgsound> element, 569
<img> element, 581
<marquee> element, 592
looping statements, 432–435
loops, 423
lossless compression, 81
lossy compression, 81
lowersrc property, 419
lowsrc attribute, <img> element, 581

LZW compression, 81
M
mailto, 56
<map> element, 592
marginheight attribute, 196
<frame> element, 577
<iframe> element, 207, 580
margins
CSS properties, 622
white space and, 362
marginwidth attribute, 196
<frame> element, 577
<iframe> element, 207, 580
marker offset property, 287
markup languages, 2
<marquee> element, attributes, 592
matching strings, 462
math object, 445
max( ) method, 445
maxlength attribute
<input type=”file”> element, 583
<input type=”password”> element, 585
<input type=”text”> element, 587
media attribute, <link> element, 591
<menu> element, 593, 701–702
menus
consistency, 374
content, separation from, 370–372
focus, 370
728

line breaks
59313bindex.qxd:WroxPro 3/23/08 3:08 PM Page 728
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

×