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

Wiley creating web sites bible 3rd edition jun 2008 ISBN 0470223634 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 (31.06 MB, 890 trang )


Crowder

ffirs.tex

V1 - 05/27/2008

1:27am

Creating Web Sites
Bible
Third Edition

Philip Crowder with David A. Crowder

Wiley Publishing, Inc.

Page iii


Crowder

ffirs.tex

V1 - 05/27/2008

Creating Web Sites
Bible
Third Edition

1:27am



Page i


Crowder

ffirs.tex

V1 - 05/27/2008

1:27am

Page ii


Crowder

ffirs.tex

V1 - 05/27/2008

1:27am

Creating Web Sites
Bible
Third Edition

Philip Crowder with David A. Crowder

Wiley Publishing, Inc.


Page iii


Crowder

ffirs.tex

V1 - 05/27/2008

1:27am

Creating Web Sites Bible, Third Edition
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2008 by Wiley Publishing, Inc., Indianapolis, Indiana
Published by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-0-4702-2363-5
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or
by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written
permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600.
Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing,
Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, or online at
/>Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim

all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may
be created or extended by sales or promotional materials. The advice and strategies contained herein may
not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required,
the services of a competent professional person should be sought. Neither the publisher nor the author
shall be liable for damages arising herefrom. The fact that an organization or Website is referred to in this
work as a citation and/or a potential source of further information does not mean that the author or the
publisher endorses the information the organization or Website may provide or recommendations it may
make. Further, readers should be aware that Internet Websites listed in this work may have changed or
disappeared between when this work was written and when it is read.
For general information on our other products and services or to obtain technical support, please contact
our Customer Care Department within the U.S. at (800) 762-2974, outside the U.S. at (317) 572-3993 or
fax (317) 572-4002.
Library of Congress Cataloging-in-Publication Data:
Crowder, Philip.
Creating web sites bible / Philip Crowder with David Crowder. — 3rd ed.
p. cm.
Includes index.
ISBN 978-0-470-22363-5 (paper/website)
1. Web site development. 2. Web sites — Design. I. Crowder, David A.
II. Title.
TK5105.8888.C76 2008
006.7 — dc22
2008004976
Trademarks: Wiley, the Wiley logo, and related trade dress are trademarks or registered trademarks of
John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be
used without written permission. All other trademarks are the property of their respective owners. Wiley
Publishing, Inc. is not associated with any product or vendor mentioned in this book.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may
not be available in electronic books.


Page iv


Crowder

f01.tex

V1 - 05/27/2008

1:28am

About the Authors
Philip Crowder of Bristol, Tennessee, is the director of the Computer and Information Management (CIM) program at Virginia Intermont College where he teaches future Web designers and
programmers the ins and outs of HTML, XHTML, XML, CSS, JavaScript, and a variety of other
Web languages and technologies. He has also done funded research into computer-based human
language translation systems.
David A. Crowder is a professional Web developer, and the author or coauthor of more than
20 books on Web design and development. He has been involved in the online community for
more than a decade, and has helped to teach hundreds of thousands of readers to create their
own cutting-edge Web sites.

Page v


Crowder

f01.tex

V1 - 05/27/2008


1:28am

Page vi


Crowder

f02.tex

V2 - 05/27/2008

1:28am

Credits
Executive Editor
Chris Webb
Development Editor
Kevin Shafer
Technical Editor
Auri Rahimzadeh
Production Editor
Debra Banninger
Copy Editor
Foxxe Editorial Services
Editorial Manager
Mary Beth Wakefield
Production Manager
Tim Tate

Vice President and Executive Group

Publisher
Richard Swadley
Vice President and Executive Publisher
Joseph B. Wikert
Project Coordinator, Cover
Lynsey Stanford
Proofreader
David Parise (Word One)
Indexer
Jack Lewis

Page vii


Crowder

f02.tex

V2 - 05/27/2008

1:28am

Page viii


Crowder

flast.tex

V2 - 05/27/2008


1:29am

From Philip Crowder (Third Edition):
Christ Jesus is my personal Savior and all that is done is done through God’s saving Grace and
abiding love.
I should acknowledge my editors above all others, for it was through their strenuous efforts that
this book was brought about. They were always professional and gentlemanly, and wonderful
exemplars of the highest ideals of publishing. I should wish to especially single out Mr. Chris
Webb, the Executive editor, for his excellence, followed closely by the very, very patient
Mr. Kevin Shafer for his brilliant editorial work, and the very astute technical editor, Mr. Auri
Rahimzadeh, whom I should one day soon hope to see write a book himself. Mr. Robert Diforio,
my literary agent and patient tutor, is the man who guided me, with lively humor and wisdom,
from the beginning to the successful conclusion of this book, and I thank him very much for all
he has done.
To my brother, the bold and brave, who early took his way and will always be one of the flag
bearers and great heralds of the Information Age. He is erudite, educated, hard-working, has led
a great life of the mind and is a tremendous writer. . . and is a generous, loving, and inspiring
brother.
Parents: This book is in honor of my father, the greatest man I have ever met, and my mother,
who shared in his vision and worked with him every step of the way to achieve it. His success is
equally hers. One could not ask for finer parents and one may only strive to be as good, as wise,
and as loving as they are.
To my wife, HuRim, whose life and faith have touched millions, who could have had so much
more in her life, and yet who, in her boundless love, took me (as I was) and made me as I am,
I joyously and lovingly dedicate this book.
To my daughters Etosha and Elysha whom I once carried so lightly and lovingly in my arms:
may God ever bless you with your mother’s faith, wisdom, love, courage, and strength.
And God bless Jordan and precious Aaiden, too.
To Gene Wine (Godfather), who imparted without measure equal amounts of love and wisdom.

To the extent that the world is better, it is so because you have uncompromisingly fought to
make it so.

ix

Page ix


Crowder

flast.tex

V2 - 05/27/2008

1:29am

Acknowledgments

To Rainer Rackl, Karl Pilger and Eric Harmsen, I have never had greater friends than you. God
bless you in all you do.
To Ahn Byong Man, hyungnim, and Ma Young Sam, Kim Man Bok, and Park Dong Sun, my
students, in whose shadows I will ever stand. It has been a blessing to have had you in our lives
and may God continue to bless Korea and continue to provide her sincere servants of your
unequalled excellence: of faithfulness, honor, integrity, insight, and wisdom.
To my students: Abdullah Lubwana, American, (serving now with honor on the far frontiers of
freedom), to Alex, Codie, Moogy, Mary, Jesse, Josh, Justin, Jean, Ishmael, Oz, Johnny, Chad,
Andron, Shawn, Brandon, and so many others of my remarkable and wonderful computer
students who over the years have proven the truth of the adage that in teaching I have been
taught, I give thanks.
For their patience and quiet support I also thank President Mike Puglisi and Provost Anne

Shumaker of Virginia Intermont (VI) College. And to my friends at VI, especially Gary Akers,
Jim and Mary, and all the wonderful people of that school. And last, though I should put this
first, to all my brothers and sisters in faith (especially those of Yun-ae-in and Onnuri, Westminister and Walnut Hill), and to all those who have loved my wife in her labor of the Lord, I dedicate this book.
From David Crowder (Second Edition):
Thanks are due to Chris Webb and Sharon Nash, my fine editors, who were there for me every
step of the way. Also Carol Sheehan, Laura Brown, Valerie Perry, Carmen Krikorian, Eric Butow,
Matthew David, Patricia Hartman, Stephanie Cottrell Bryant, Wendy Willard, Chris Stone, Doug
Sahlin, Bud Smith, and Andy Bailey, without whom this book would not be in your hands right
now. All helped to make this the best book we could all put together for you. And they’re just
the tip of the iceberg: about a zillion people work their tails off anonymously and behind the
scenes at Wiley to bring you the finest books they can possibly produce. My hat is off to all of
them, from the top editors to the humblest laborer on the loading dock. Last, but by no means
least, I’d like to say how much I appreciate all the hard work done by my literary agent,
Robert G. Diforio, without whose help I would be lost in the intricacies of the publishing world.

x

Page x


Crowder

cag.tex

V2 - 05/27/2008

1:30am

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxix


Part I Laying the Foundation
Chapter 1: The Basics of Building Web Pages and Sites ..................................................................3
Chapter 2: Popular Web Design Tools ...........................................................................................33

Part II The Basics
Chapter
Chapter
Chapter
Chapter
Chapter

3:
4:
5:
6:
7:

History and Development of the Internet and HTML .................................................63
HTML Building Blocks ................................................................................................. 81
Links, Hotspots, and Web Site Navigation ................................................................127
The Elements of Color and Images in Web Pages .................................................... 163
Text Formatting ..........................................................................................................205

Part III Advanced Design Features
Chapter 8: Harnessing the Power of Tables .................................................................................241
Chapter 9: Organizing Your Site with Frames .............................................................................287
Chapter 10: Getting Input with Forms ........................................................................................ 321

Part IV Making It Look Professional
Chapter

Chapter
Chapter
Chapter

11:
12:
13:
14:

Adding Multimedia and Other Objects ................................................................... 361
Styling Web Pages with Cascading Style Sheets ......................................................415
Making Dynamic Pages with JavaScript ...................................................................477
Putting It on the Web .............................................................................................. 525

Part V Transitioning to the Future: XHTML, XML, and Ajax
Chapter 15: XHTML ..................................................................................................................... 559
Chapter 16: Designing with XML .................................................................................................603
Chapter 17: Ajax ........................................................................................................................... 631

Part VI Images on the Web
Chapter 18: Finding, Creating, and Enhancing Images on the Web ..........................................651

Part VII Cashing in on eCommerce
Chapter 19: Setting Up Your Store ...............................................................................................681
Chapter 20: Using Advertising ......................................................................................................713
Chapter 21: Covering All the Bases ..............................................................................................747

xi

Page xi



Crowder

cag.tex

V2 - 05/27/2008

1:30am

Contents at a Glance

Part VIII Keeping Your Site Fresh
Chapter 22: Maintaining Your Site ...............................................................................................767
Chapter 23: RSS ............................................................................................................................779
Chapter 24: Blogging .....................................................................................................................795

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 817

xii

Page xii


Crowder

ftoc.tex

V2 - 05/27/2008


1:29am

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxix

Part I Laying the Foundation
Chapter 1: The Basics of Building Web Pages and Sites . . . . . . . . . . . 3
Web Browsers ..........................................................................................................................4
Web Pages ................................................................................................................................9
Web Sites ...............................................................................................................................13
Analyzing Web Site Types .................................................................................................... 15
Personal home pages ...................................................................................................16
Informational sites .......................................................................................................16
Organizational sites .....................................................................................................18
Political sites ................................................................................................................19
Commercial sites .........................................................................................................19
Understanding Internet Demographics .................................................................................23
Finding good information ...........................................................................................23
Surveying site visitors ..................................................................................................25
Determining Your Approach .................................................................................................26
Focusing on goals ........................................................................................................27
Deciding on complexity levels ....................................................................................27
Establishing a budget ..................................................................................................28
Dos and Don’ts of Web Site Development ...........................................................................29
Tips for good Web sites ..............................................................................................29
Top ways to have bad sites .........................................................................................30
Summary ................................................................................................................................31

Chapter 2: Popular Web Design Tools . . . . . . . . . . . . . . . . . . . 33
Adobe Creative Suite 3 (CS3) ...............................................................................................33
Photoshop ....................................................................................................................34

Dreamweaver ...............................................................................................................39
Illustrator .....................................................................................................................46
Flash Professional ........................................................................................................46
Photoshop Extended ...................................................................................................48
Fireworks .....................................................................................................................48
Acrobat ........................................................................................................................ 49
Contribute ....................................................................................................................49

xiii

Page xiii


Crowder

ftoc.tex

V2 - 05/27/2008

1:29am

Contents

Freeware and Shareware ....................................................................................................... 50
Image-editing programs .............................................................................................. 52
Image-creation programs .............................................................................................53
Other graphics-related applications ............................................................................54
Designing for the Mobile Web ..............................................................................................55
Background for Mobile Web design ...........................................................................56
Current difficulties with Web usage on mobile devices ............................................57

Future of the Mobile Web ..........................................................................................58
Summary ................................................................................................................................59

Part II The Basics
Chapter 3: History and Development of the Internet and HTML . . . . . . 63
Origins of the Internet .......................................................................................................... 64
Emergence of packet switching and ARPANET .........................................................64
Evolution of Ethernet ..................................................................................................68
Public emergence of the Internet ................................................................................70
Emergence of hypertext .............................................................................................. 71
Development and Evolution of HTML .................................................................................73
Hypercard ....................................................................................................................74
HTML .......................................................................................................................... 74
Future trends in HTML ...............................................................................................77
The Arrival of XHTML ................................................................................................78
Summary ................................................................................................................................79

Chapter 4: HTML Building Blocks . . . . . . . . . . . . . . . . . . . . . 81
Creating a Web Page Using HTML .......................................................................................81
Head and Body Sections ....................................................................................................... 90
<head> section .......................................................................................................... 91
<body> section ..........................................................................................................95
Block-Level Elements ............................................................................................................ 95
Head .............................................................................................................................96
Title ..............................................................................................................................96
Body .............................................................................................................................96
Inline elements ............................................................................................................97
Paragraphs ................................................................................................................... 99
Unordered lists ..........................................................................................................101
Ordered lists ..............................................................................................................102

Definition lists ...........................................................................................................104
Heading tags ..............................................................................................................104
HTML Tools ........................................................................................................................ 104
Link checkers ............................................................................................................ 104
Code validators ..........................................................................................................105

xiv

Page xiv


Crowder

ftoc.tex

V2 - 05/27/2008

1:29am

Contents

Compatibility testers ................................................................................................. 105
Authoring tools ..........................................................................................................107
Designing a Simple Web Page ............................................................................................114
Logical and Physical Elements ............................................................................................118
Physical tags .............................................................................................................. 120
Logical tags ................................................................................................................121
Incorporating logical and physical tags ....................................................................121
Special Characters and Encoding Schemes: ASCII and Unicode .......................................124
Element Quick Reference ....................................................................................................125

Summary ..............................................................................................................................125

Chapter 5: Links, Hotspots, and Web Site Navigation . . . . . . . . . . . 127
Example Web Site ...............................................................................................................129
Internal Links with Anchor Tags ........................................................................................132
Developing a Sample Web Site ...........................................................................................135
Navigating within your Web site ..............................................................................137
Links between pages of a site ...................................................................................139
Creating Web Pages for Family and Sports ..............................................................140
Creating the Family page ..........................................................................................142
Creating the Sports and Schools sections .................................................................146
Absolute and Relative Paths ................................................................................................147
Locking relative URLs with the BASE element ........................................................ 148
Previous and Next Links .....................................................................................................149
External Links ......................................................................................................................150
Getting hypertext references right ............................................................................150
Creating internal links with local anchors ............................................................... 151
Sending e-mail with mailto links ..............................................................................152
Other types of links .................................................................................................. 152
Linking via images .................................................................................................... 153
Linking via Image Maps ............................................................................................154
Storyboarding ......................................................................................................................157
Links Quick Reference ........................................................................................................160
Summary ..............................................................................................................................160

Chapter 6: The Elements of Color and Images in Web Pages . . . . . . . 163
Setting Color Attributes .......................................................................................................163
Changing color settings .............................................................................................164
Setting background colors ........................................................................................ 165
Specifying foreground colors ....................................................................................166

Changing link colors for your browser ....................................................................166
Using the Three C’s: Complement, Contrast, and Coordination ...................................... 167
Choosing complementary colors .............................................................................. 167
Ensuring contrast and visibility ................................................................................168
Coordinating color schemes ......................................................................................169
Understanding color warmth ....................................................................................169

xv

Page xv


Crowder

ftoc.tex

V2 - 05/27/2008

1:29am

Contents

Using Color Names and Hex Numbers ..............................................................................170
Decoding RGB triplets ...............................................................................................171
Facing limitations of named colors .......................................................................... 172
Using color pickers ................................................................................................... 173
Popular Graphics Formats .................................................................................................. 176
Graphics Interchange Format (GIF) .........................................................................176
Joint Photographic Experts Group (JPEG, or JPG) ..................................................178
Portable Network Graphics (PNG) ...........................................................................179

Setting Background and Foreground Color ....................................................................... 179
Coding for background .............................................................................................179
Coding for foreground (text) ....................................................................................180
Adding Background Images ................................................................................................181
Calculating sizes for tiling .........................................................................................182
Dealing with ’’sidebar’’ backgrounds ........................................................................ 183
Checking seamlessness ..............................................................................................185
Avoiding busy backgrounds ......................................................................................186
Choosing color and contrast .....................................................................................186
Adding Images .....................................................................................................................186
Coding for images using some CSS styles ................................................................188
Aligning Images ...................................................................................................................189
Aligning multiple images .......................................................................................... 193
Setting margins ..........................................................................................................194
Setting borders .......................................................................................................... 195
Setting Image Size ............................................................................................................... 197
Using the height and width attributes ......................................................................197
Solving Image Problems ......................................................................................................199
Using thumbnail images to speed up page downloads ........................................... 199
Embedding special fonts ...........................................................................................200
Quick Reference ..................................................................................................................201
Summary ..............................................................................................................................203

Chapter 7: Text Formatting . . . . . . . . . . . . . . . . . . . . . . . . 205
Fonts ....................................................................................................................................205
Customizing Text with Character Styles ............................................................................ 207
Italicizing text ............................................................................................................207
Bolding text ...............................................................................................................208
Preformatting text ......................................................................................................208
Adding superscripts and subscripts using HTML and CSS .....................................209

<span> and <div> .................................................................................................211
Using the FONT and BASEFONT Elements ......................................................................211
Specifying a size ........................................................................................................212
Font size options and inline styles ...........................................................................212
Scalability and absolute measurement ......................................................................215
Using relative size in standard HTML coding ..........................................................216

xvi

Page xvi


Crowder

ftoc.tex

V2 - 05/27/2008

1:29am

Contents

Comparing font size with heading size ....................................................................216
Overriding default font faces ....................................................................................217
Coloring text ..............................................................................................................218
Using fonts with style ............................................................................................... 218
Aligning and Indenting Text ...............................................................................................221
Dealing with deprecation ..........................................................................................221
Indenting with BLOCKQUOTE ................................................................................222
Choosing Character Sets ..................................................................................................... 223

Using Special Characters and Entities ................................................................................227
Summary ..............................................................................................................................236

Part III Advanced Design Features
Chapter 8: Harnessing the Power of Tables . . . . . . . . . . . . . . . . 241
Adding Tables and Setting Table Size ................................................................................241
Managing Borders ................................................................................................................248
Frames and rules .......................................................................................................250
Using Padding and Spacing ................................................................................................263
Aligning Tables and Cell Contents .....................................................................................265
Setting horizontal alignment .....................................................................................266
Setting vertical alignment ..........................................................................................271
Preventing word wrap ...............................................................................................272
Spanning Rows and Columns .............................................................................................273
Working with Images and Color ........................................................................................275
Specifying background images ..................................................................................275
Specifying background colors ...................................................................................278
Tables Quick Reference .......................................................................................................283
Summary ..............................................................................................................................284

Chapter 9: Organizing Your Site with Frames . . . . . . . . . . . . . . 287
Designing Frame Layouts ....................................................................................................288
Analyzing functional needs .......................................................................................289
Creating navigation layouts .......................................................................................289
Setting up action or result layouts ............................................................................290
Creating Framesets ..............................................................................................................291
Setting columns and rows .........................................................................................292
Mixing pixel, percentage, and relative sizing ...........................................................296
Preventing resizing ....................................................................................................300
Specifying frame names and contents ...................................................................... 300

Nesting framesets ...................................................................................................... 302
Adding NOFRAMES content .................................................................................... 304
Setting Targets for Your Links ............................................................................................305
Targeting custom-named frames ...............................................................................305

xvii

Page xvii


Crowder

ftoc.tex

V2 - 05/27/2008

1:29am

Contents

Base target element ....................................................................................................306
Expandable and collapsible list .................................................................................307
Using reserved frame names .....................................................................................310
Customizing Frame Borders and Margins ..........................................................................310
Setting border width .................................................................................................311
Handling border colors .............................................................................................313
Setting margin width .................................................................................................313
Setting Scroll Bar Options ...................................................................................................313
Alternatives to framesets and frames ........................................................................314
Avoiding Frame Problems ...................................................................................................316

Making sure that you have enough frames ..............................................................316
Adding foreign elements ...........................................................................................316
What size is the user’s screen? ..................................................................................316
Using too many frames .............................................................................................317
Providing backup navigation ....................................................................................317
Frames Quick Reference ..................................................................................................... 318
Summary ..............................................................................................................................319

Chapter 10: Getting Input with Forms . . . . . . . . . . . . . . . . . . 321
Adding Forms ......................................................................................................................321
The INPUT element ..................................................................................................322
Naming elements .......................................................................................................323
Getting Short Data with Text Boxes ...................................................................................324
Setting box size ......................................................................................................... 325
Defining the maximum length of input ................................................................... 326
Prefilling a text box ...................................................................................................327
Locking content with readonly and disabled ...........................................................329
Gathering Information with Text Areas ..............................................................................330
Sizing text areas .........................................................................................................330
Setting wordwrap ......................................................................................................331
Setting default contents .............................................................................................333
Making Choices with Check Boxes and Option Buttons ...................................................334
Adding check boxes ..................................................................................................335
Grouping option buttons ..........................................................................................336
Setting a default choice .............................................................................................336
Saving Space with the SELECT and OPTION Elements ....................................................338
Specifying values .......................................................................................................340
Setting menu types ....................................................................................................341
Allowing multiple selections .....................................................................................341
Setting a default choice .............................................................................................343

Using INPUT Buttons ..........................................................................................................343
Adding the Submit button ........................................................................................343
Adding a Reset button .............................................................................................. 344
Creating custom buttons ...........................................................................................345
Going pictorial with graphical buttons .....................................................................345

xviii

Page xviii


Crowder

ftoc.tex

V2 - 05/27/2008

1:29am

Contents

Using the BUTTON Element .............................................................................................. 347
Adding Hidden Fields .........................................................................................................349
Adding Labels ......................................................................................................................349
Setting Tab Order ................................................................................................................351
Specifying Access Keys ........................................................................................................351
Submitting the Form ...........................................................................................................353
Simple DOM ........................................................................................................................354
Summary ..............................................................................................................................356


Part IV Making It Look Professional
Chapter 11: Adding Multimedia and Other Objects . . . . . . . . . . . 361
Adding Audio ......................................................................................................................362
Choosing a file type ..................................................................................................363
Embedding audio ......................................................................................................364
Setting volume ...........................................................................................................365
Using NOEMBED ......................................................................................................366
Finding digital audio sources ....................................................................................366
Embedding Video ................................................................................................................371
Running a movie .......................................................................................................372
Finding digital video sources ....................................................................................373
Animating with Adobe Flash .............................................................................................. 374
Understanding the Flash Layout .........................................................................................374
The Stage ...................................................................................................................374
Scenes ........................................................................................................................375
Layers .........................................................................................................................376
The Timeline ............................................................................................................. 376
The toolbox ...............................................................................................................377
Tool panels ................................................................................................................378
Creating Objects ..................................................................................................................381
Drawing lines with the Line tool ..............................................................................382
Setting stroke characteristics .....................................................................................382
Selecting and deleting objects ...................................................................................383
Making shapes with tools ......................................................................................... 384
Saving your work ......................................................................................................385
Importing art .............................................................................................................385
Using the Library panel ............................................................................................ 386
Modifying Objects ...............................................................................................................386
Stretching and distorting objects ..............................................................................386
Grouping objects .......................................................................................................388

Scaling ........................................................................................................................388
Rotating and skewing ................................................................................................389
Straightening and smoothing ....................................................................................390

xix

Page xix


Crowder

ftoc.tex

V2 - 05/27/2008

1:29am

Contents

Using gradient fills ....................................................................................................390
Working with bitmap fills .........................................................................................392
Working with Text ..............................................................................................................393
Adding text ................................................................................................................393
Choosing fonts .......................................................................................................... 393
Setting font characteristics ........................................................................................393
Creating text effects ...................................................................................................395
Working with Animation Timelines ...................................................................................396
Using frames ..............................................................................................................396
Assigning keyframes ..................................................................................................397
Adding Layers ............................................................................................................397

Adding objects to the Layers ....................................................................................398
Converting objects to symbols ..................................................................................398
Creating animation ....................................................................................................399
Tweening action ........................................................................................................399
Creating more Layer effects ...................................................................................... 400
Using sound .............................................................................................................. 402
Adding MP3 sound ...................................................................................................403
Synchronizing sound and action ..............................................................................404
Using Advanced Techniques ...............................................................................................405
Programming with ActionScript ............................................................................... 406
Adding actions ...........................................................................................................406
Exporting and Publishing Movies .......................................................................................407
Exporting movies ...................................................................................................... 407
Publishing movies .....................................................................................................408
Tips for optimizing your movies ..............................................................................413
Summary ..............................................................................................................................413

Chapter 12: Styling Web Pages with Cascading Style Sheets . . . . . . . 415
Testing Your Browser ..........................................................................................................416
Coping with Browser Support Issues ................................................................................. 416
Cascading Priorities .............................................................................................................417
Going inline with the style attribute ........................................................................ 417
Embedding with the <style> tag .............................................................................418
Linking external stylesheets ......................................................................................419
Redefining HTML Elements ................................................................................................420
Assigning Classes .................................................................................................................421
Using IDs .............................................................................................................................422
Defining Nested Elements with Contextual Selectors ........................................................423
Cool effects with CSS ................................................................................................423
Consulting the CSS Reference .............................................................................................426

CSS1 properties .........................................................................................................426
CSS2 properties .........................................................................................................435
Using Stylesheet-Creation Programs ...................................................................................462
Interesting CSS Sites ............................................................................................................463

xx

Page xx


Crowder

ftoc.tex

V2 - 05/27/2008

1:29am

Contents

Adding Layers ......................................................................................................................464
Using CSS positioning properties .............................................................................465
Going with the flow ..................................................................................................466
Choosing absolute or relative positioning ................................................................466
Nested elements ........................................................................................................ 468
Overlapping Layers ................................................................................................... 469
Stacking layers with z-order ..................................................................................... 470
Using transparency and background color .............................................................. 470
Clipping Layer Content .......................................................................................................471
Visibility of layers ......................................................................................................472

Handling Large Elements with Overflow Attributes ..........................................................472
Visible overflow .........................................................................................................473
Hidden overflow ........................................................................................................473
Scroll bars ..................................................................................................................474
CSS and Layers Quick Reference ........................................................................................475
Summary ..............................................................................................................................475

Chapter 13: Making Dynamic Pages with JavaScript . . . . . . . . . . . 477
Trying Out JavaScript ..........................................................................................................477
Understanding JavaScript ....................................................................................................479
Working with variables, constants, and literals .......................................................479
Affecting values with operators .................................................................................483
Adding statements using event handlers ..................................................................488
Combining statements into functions .......................................................................494
Making choices with If and If . . . Else ....................................................................496
Going in loops ...........................................................................................................499
Using Events to Trigger Scripts .......................................................................................... 503
Triggering on page loads and unloads .....................................................................504
Reacting to mouse movements .................................................................................506
Clicking and double-clicking ....................................................................................507
Pressing and releasing keys .......................................................................................509
Seeing Elements as Objects .................................................................................................509
Understanding properties ..........................................................................................510
Working with methods .............................................................................................512
Form Validation ...................................................................................................................513
Examining Browser Compatibility ......................................................................................517
JavaScript Quick Reference .................................................................................................522
Summary ..............................................................................................................................522

Chapter 14: Putting It on the Web . . . . . . . . . . . . . . . . . . . . 525

Getting Your Domain Name ...............................................................................................525
Choosing a domain name .........................................................................................526
Picking a registrar ......................................................................................................527
Coping with registration pitfalls ...............................................................................530

xxi

Page xxi


Crowder

ftoc.tex

V2 - 05/27/2008

1:29am

Contents

Finding a Web Hosting Provider ........................................................................................531
Picking the right Web server ....................................................................................531
Determining your space needs ..................................................................................534
Choosing a nonvirtual, virtual, dedicated, or co-located server ..............................534
Balancing price-service ratios ....................................................................................536
Investigating Web space providers ...........................................................................536
Testing Responsiveness to Your Needs ...............................................................................538
Obtaining customer service ...................................................................................... 539
Assessing technical support ...................................................................................... 539
Avoiding Common Provider Scams ....................................................................................539

Thinking like a crook ................................................................................................540
Suffering domain name theft .................................................................................... 540
Getting ‘‘unlimited’’ traffic or space ..........................................................................541
Rushing deadlines for special deals ..........................................................................541
Exploring Bells and Whistles ..............................................................................................542
Getting extra e-mail accounts ...................................................................................542
Redirecting messages .................................................................................................542
Using autoresponders to provide information ......................................................... 544
Getting visitor statistics .............................................................................................544
Using control panels to set site options ...................................................................545
Becoming a reseller ................................................................................................... 548
Uploading Your Pages .........................................................................................................548
Transferring with FTP ...............................................................................................549
Uploading with Web browsers via HTTP ................................................................ 553
Web Posting Quick Reference ............................................................................................ 554
Summary ..............................................................................................................................555

Part V Transitioning to the Future: XHTML, XML, and Ajax
Chapter 15: XHTML . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
A Quick Review of HTML .................................................................................................. 560
Enter XHTML ......................................................................................................................560
Transitioning to XHTML 1.0 ..............................................................................................562
Document Type Definitions (DTDs) .........................................................................562
Making HTML compliant with XML ........................................................................569
Contrasting XHTML with HTML 4.0 .......................................................................571
Modules .....................................................................................................................573
Frowned-upon practices in older HTML syntax ......................................................574
Creating an XHTML Document ..........................................................................................578
Namespace .................................................................................................................579
CDATA and PCDATA ...............................................................................................580

White space ...............................................................................................................581
Code Validation in an XHTML Document .........................................................................582
Making Your Site Mobile with WAP/WML ........................................................................585

xxii

Page xxii


Crowder

ftoc.tex

V2 - 05/27/2008

1:29am

Contents

What is WML? .....................................................................................................................586
Dealing with WML ....................................................................................................586
WML Tags .................................................................................................................588
Shuffling the cards .................................................................................................... 590
Interacting with Users .........................................................................................................593
Forms in WML ..........................................................................................................593
Specifying the format ................................................................................................595
Specifying required values ........................................................................................595
Menus a´ la card .........................................................................................................595
Multiple-choice menus ..............................................................................................596
Differences between HTML lists and WML lists ......................................................597

Transforming XHTML into WML .......................................................................................598
WML Web Sites .................................................................................................................. 602
Summary ..............................................................................................................................602

Chapter 16: Designing with XML . . . . . . . . . . . . . . . . . . . . . 603
Designing with XML ........................................................................................................... 603
XML Rules .................................................................................................................605
Getting different XML vocabularies to work together — namespaces ....................606
Classifying content versus defining presentation .....................................................607
Specifying a CSS ........................................................................................................608
Specifying an XSL stylesheet .....................................................................................609
Similarities to a programming language ...................................................................613
Defining the structure of an XML document ...........................................................615
Customizing tags .......................................................................................................617
More on DTD ............................................................................................................618
Schemas ...............................................................................................................................620
string and numeric data types ..................................................................................622
Date and time data types ..........................................................................................625
Primitive data types ...................................................................................................626
Schema format ...........................................................................................................626
XML Web Sites ....................................................................................................................629
Summary ..............................................................................................................................629

Chapter 17: Ajax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
XMLHttpRequest ................................................................................................................. 632
XMLRequest in Switch Format Case 0 .....................................................................638
XMLRequest in Switch Format Case 1 .....................................................................638
XMLRequest in Switch Format Case 2 .....................................................................640
XMLRequest in Switch Format Case 3 .....................................................................640
XMLRequest in Switch Format Case 4 .....................................................................640

Making an XMLHttpRequest .....................................................................................642
DOM 3 Specifications for IDL Node Interface ...................................................................644
Ajax and the Mobile Web ...................................................................................................645

xxiii

Page xxiii


×