-->
Navigation
HTML, XHTML, and CSS Bible, 5th edition. Wiley

HTML, XHTML, and CSS Bible, 5th edition. Wiley

Now pay Easier and Secure using Paypal
Price:

Read more

Steven M. Schafer

Companion Web Site

Master HTML 4.01, CSS 2.1 and XHTML 1.1
Contruct static and dynamic Web pages
Build for a mobile and ocial networking world

E-books Shop
HTML, XHTML, and CSS Bible, 5th edition

About the Author
Steven M. Schafer is a broad technologist and a veteran of publishing. He’s been in and
around technology as a programmer, an editor, a product specialist, a technical manager,
and a Web developer. Steve employs both open-source and proprietary technologies
and has worked with the Internet since the mid-1990s. He can be reached by e-mail at
sschafer@synergy-tech.com.

Acknowledgements
Abook like this requires a lot of hard work from a lot of talented people. 
This talent and hard work deserves recognition and thanks. 
As such, the author would like to thank the following:
The management team at Wiley Publishing for continuing to support large, tutorial reference
books so folks like you (the reader) can benefit.

Jenny Watson, acquisitions editor, for getting the ball rolling on this edition.

Carol A. Long, executive acquisitions editor, for picking up the rolling ball, keeping the project
on track, and keeping this author both responsible and happy.

Adaobi Obi Tulton, senior project editor and the best developer I’ve had the pleasure to work
with. Adaobi simultaneously kept everything on track and provided crucial insights and feedback
throughout the process — all while treating everyone else as valuable team members.

Shawn Kessel, technical editor, for ensuring that the information provided is accurate as well as
pertinent, and for providing many useful insights.

Rebecca Anderson, production editor, for making sure each element was ushered through the
editing process, maintaining the high quality of writing found within.

Luann Rouff, copy editor, who proved to be another in the ‘‘best of’’ class. Luann helped make
my gibberish legible, ironed out the organizational rough spots, and otherwise finely crafted the text.

Wiley’s production department, for ensuring that the text was consistent, well organized, and
legible, and made it through the production process intact.
John Daily, friend and markup guru, whose hard work is still paying dividends today.


Introduction

Welcome to HTML, XHTML, and CSS Bible, Fifth Edition. This book was conceived,
designed, and written to provide a comprehensive overview of the two largest
Web technologies, HyperText Markup Language (HTML) and Cascading Style Sheets (CSS).
This book serves as an introduction and reference to the information you need to create
documents — simple and complex — for the World Wide Web

A Brief History of the Internet
and the World Wide Web
The World Wide Web is omnipresent in our lives today, and most computers and computerized
devices are connected to it. However, the Web and its underlying Internet infrastructure had a
very different childhood that betrays the consumer and commercial base it has today.
The Internet has its roots in the U.S. Department of Defense Advanced Research Project Agency
(ARPA) project begun in or around 1960. Among the project’s goals was the ability to network
computers quickly and across great distances. The network was to be designed to be almost
fail-safe, enabling connected computers to continue communicating even if assorted routes
between them were to fail.

In 1969, the ARPANet was born, connecting several key universities. The network continued
to grow, with more and more universities coming online. One of the goals of the initial
project — robust, nearly fail-safe performance — was realized via the Internet Protocol (IP).
This protocol enabled communication packets to find various routes to a destination in case one
or more of the routes became unstable. This communication protocol became the backbone of
today’s Internet, and is how the Internet got its name.

The Transmission Control Protocol was joined with the IP to provide a robust transmission suite,
a marriage of two protocols to offer more flexibility and the ability to create better communications
applications for the Internet.

In the 1980s, the Internet went through several transitions. Although it was highly populated by
educational institutions, the U.S. military hadn’t forgotten its original project. Other government
agencies also took notice and joined the crowd online; and the military decided to create its own
network, MILNET, lessening the load slightly.

By 1992, the Internet was far and away the most popular network in the world. During this
time, Tim Berners-Lee, a British software engineer and computer scientist, created HyperText
Markup Language to create documents, a protocol — HyperText Transfer Protocol (HTTP) — to
send such documents, and the first browser editor, called the World Wide Web. The ‘‘Web’’ soon
came to the attention of the National Center for Supercomputing Applications (NCSA), where a
programming team decided to create a better browser. Thus was Mosaic born, the first browser
to support a high degree of multimedia. 
Mosaic helped usher in the crop of modern browsers we use today.

As the Web continued to be adopted outside of the government and educational sectors, it
became more consumer-savvy. Many companies began using the Web infrastructure for marketing
and support purposes, while many Web developers began to target a wider, nontechnical, audience.

By the early 2000s, the Web was accessible by almost any network-connected computer, many
electronic devices, and some unlikely consumer devices such as automobiles. Each of these connected
devices uses the same type of connection, the same languages to define documents, and
the same protocols to send the information.

As more and more nontechnical users began using the Web, web ‘‘pages’’ began to look more
like high-quality printed documents — resembling newspapers, brochures, magazines, and the
like. This movement in content signaled how far the Web had come from its inception — from
technical, text-only pages to full-color, heavily designed documents.

During the entire evolution of the World Wide Web, and especially in the last few years, standards,
tools, and related applications have changed and evolved, sometimes at a very rapid pace.
This gives Internet books a wide realm to cover.

Who Should Read This Book?
This book is geared toward a wide audience. Readers who are just getting started with HTML
and Web content will benefit the most, as this book provides both a solid learning foundation
as well as ample reference material for later perusal. Experienced users will find the chapters
covering new standards and technologies to be the most useful, but also will appreciate having a
comprehensive reference for consultation.

Although the Web is technical in nature, this book boils down the technology into simple and
straightforward terms. Whether you qualify as a computer scientist or as a computer neophyte,
you will be able to understand, adopt, and deploy the information throughout this book.

What Is Contained in This Book?
This book is divided into four major sections, plus five appendixes.

Part I: Creating Content with HTML
This part of the book covers the basics of HTML — the tags, attributes, and structure that make
up the language. You learn how to structure a document, format text, and incorporate multimedia.
You also learn basic and advanced scripting to lend a dynamic edge to your documents.
Part II: HTML Tools and Variants
This part of the book covers utilities to help you author, validate, and troubleshoot your documents.
A few useful HTML variants and extensions — including XML and XHTML Basic — are also covered.
Part III: Controlling Presentation with CSS
This part of the book covers the basics of CSS, the syntax of CSS selectors, valid properties and
values, and how to use CSS properties to effectively format the various portions of your document.
You will also learn how to format a document for printing using CSS media types.
Part IV: Additional CSS Tools
The last part of this book covers additional CSS topics, including advanced layout, user interface
styles, testing and validating CSS, and some CSS tips and tricks.

How to Use This Book
This book can be used in a variety of ways depending upon your skill level and intent.

The sequential read
If you need to learn HTML and CSS from beginning to end, then a sequential read — reading
the chapters in order from beginning to end — is for you. The chapters are designed to introduce
topics in a particular order to get you started and build toward more advanced topics.
For a tutorial approach, choose a sequential read.
A targeted or random read

If you need only a refresher of certain material or want to learn in a different order than the
chapters provide, then a targeted or random read — finding a topic in the table of contents or
index to read, or reading chapters in a different order than numbered — is for you. Although the
chapters were written to build on one another, they also are topical and encapsulate individual
subjects. Find a chapter with information you need to learn and read it, or find a section within
a chapter and read it alone.

For a referential approach, choose a targeted or random read.


Screenshot

E-books Shop

Purchase Now !
Just with Paypal



Product details
 Price
 File Size
 18,039 KB
 Pages
 795 p
 File Type
 PDF format
 ISBN
 978-0-470-52396-4
 Copyright
 2010 by Wiley Publishing, Inc 


Contents at Glace
Introduction
Part I: Creating Content with HTML
Chapter 1: What Is a Markup Language?
Chapter 2: HTML Values and Units
Chapter 3: What Goes into a Web Document?
Chapter 4: The HEAD Elements
Chapter 5: Text Structuring Essentials
Chapter 6: Character Formatting Essentials
Chapter 7: Lists
Chapter 8: Links
Chapter 9: Tables
Chapter 10: Frames
Chapter 11: Forms
Chapter 12: Colors and Images
Chapter 13: Multimedia
Chapter 14: Special Characters
Chapter 15: Internationalization and Localization
Chapter 16: Scripts
Chapter 17: Dynamic HTML
Chapter 18: The Future of HTML: HTML5
Part II: HTML Tools and Variants
Chapter 19: Web Development Software
Chapter 20: Publishing Your Site
Chapter 21: An Introduction To XML
Chapter 22: Creating Mobile Documents
Chapter 23: Tidying and Validating Your Documents
Chapter 24: HTML Tips and Tricks
Part III: Controlling Presentation with CSS
Chapter 25: CSS Basics
Chapter 26: Style Definitions
Chapter 27: CSS Values and Units
Chapter 28: CSS Inheritance and Cascade
Chapter 29: Font Properties
Chapter 30: Text Formatting
Chapter 31: CSS Lists
Chapter 32: Padding, Margins, and Borders
Chapter 33: Colors and Backgrounds
Chapter 34: CSS Layouts
Chapter 35: Pseudo-Elements and Generated Content
Chapter 36: Dynamic HTML with CSS
Chapter 37: Media Styles and Defining Documents for Printing
Chapter 38: The Future of CSS: CSS3
Part IV: Additional CSS Tools
Chapter 39: User Interface Styles
Chapter 40: Testing and Validating CSS
Chapter 41: CSS Tips and Tricks
Appendix A: XHTML Element Quick Reference
Appendix B: HTML Special Characters Quick Reference
Appendix C: CSS 2.1 Properties Quick Reference
Appendix D: CSS 2.1 Selectors Quick Reference
Appendix E: Pseudo-Elements and Pseudo-Classes Quick Reference
Index


Table of Contents

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . xxxix
Part I: Creating Content with HTML
Chapter 1:What Is aMarkup Language?
What Are We Doing Here? ...........................................3
Understanding Hypertext ..................................................4
Understanding Markup Instructions ...............................4
Understanding Markup Language ................................6
Summary .........................................................................8
Chapter 2: HTML Values and Units
Basic Tag Attribute Format .....................................................9
Common Attributes ..............................................12
Tag identifiers — IDs and classes ...................................12
IDs ..............................................................12
Classes .................................................12
Text and Comments ......................................................13
Comments ...............................................13
CDATA sections ................................................14
Uniform Resource Indicators ..................................14
Language and International Options ....................................15
Language code ...............................................15
Text direction ........................................15
Summary .......................................................16
Chapter 3: What Goes into a Web Document?
Specifying Document Type ..............................17
Overall Document Structure: HTML, Head, and Body .........................18
The <html> tag ...............................................18
The <head> tag ........................................................18
The <body> tag ...........................................19
Style Definitions .......................................................20
Block Elements: Markup for Paragraphs and Other Blocks of Content ..................21
Formatted paragraphs ..........................................21
Headings .....................................................22
Quoted text ......................................................24
List elements ..................................................................24
Preformatted text ............................................................26
Divisions .....................................................27
Inline Elements: Markup for Characters .................................28
Basic inline tags ...........................................29
Spanning text ..................................................31
Special Characters (Entities) ...................................31
Organizational Elements .......................................32
Tables ..................................................................32
Forms .........................................................34
Linking to Other Pages ......................................35
Images ..................................................................37
Comments ....................................................38
Scripts ...............................................................38
Putting It All Together ...................................................39
Summary ..................................................................40
Chapter 4: The HEAD Elements
Specifying the Document Title .............................41
Providing Information to Search Engines .................................41
Setting the Default Path ....................................43
Script Sections ..............................................45
Style Sections .........................................45
Specifying Profiles ......................................45
Background Color and Background Images ........................46
Specifying the document background color ...................46
Specifying the document background image .........................47
Summary .................................................48
Chapter 5: Text Structuring Essentials
Formatting Paragraphs ..........................49
Line Breaks ...............................51
Divisions ...........................52
Rules .......................................56
Block Quotes ....................................57
Preformatted Text ........................58
Summary ........................59
Chapter 6: Character Formatting Essentials
Methods of Text Control ........................................61
The <font> tag .......................................................61
Emphasis and other text tags ............................62
CSS text control ........................................62
Bold and Italic Text ..................................65
Use of Emphasis Instead of Italics .................66
Monospace (Typewriter) Fonts ..................................66
Superscripts and Subscripts .................................67
Abbreviations ........................................67
Marking Editorial Insertions and Deletions ..................68
Grouping Inline Elements with the Span Tag ................................68
Summary ........................................70
Chapter 7: Lists
Understanding Lists ...............................71
Ordered (Numbered) Lists ............................72
Unordered (Bulleted) Lists ....................................77
Definition Lists .....................................81
Nested Lists ..............................83
Summary ..................................85
Chapter 8: Links
What’s in a Link? .................................87
Linking to a Web Page ..............................89
Absolute versus Relative Links ...............................90
Link Targets ....................................92
Link Titles .......................................93
Keyboard Shortcuts and Tab Order ............................94
Keyboard shortcuts .................................94
Tab order ................................95
Creating an Anchor ......................................96
Choosing Link Colors ......................96
Link Destination Details ...............................98
The Link Tag ..............................99
Summary ..........................100
Chapter 9: Tables
Parts of an HTML Table ..............................101
Table Width and Alignment ................103
Cell Spacing and Padding .....................107
Borders and Rules .....................................108
Table borders ............................108
Table rules .............................110
Rows .................................................111
Cells ..........................................112
Table Captions .....................................114
Row Groups — Header, Body, and Footer ............117
Background Colors ..............................................119
Spanning Columns and Rows ...............................120
Grouping Columns ....................................125
Formatting with Tables ..........................................127
Rudimentary Formatting with Tables .........................127
Real-world examples ...................................131
Floating page ......................................132
Odd graphics and text combinations ...............................134
Navigational menus and blocks ..........................139
Multiple columns ........................................141
Summary .......................................142
Chapter 10: Frames
Frames Overview .......................................143
Framesets and Frame Documents .................................144
Creating a frameset .......................................144
The frameset tag .........................146
The frame tag .................................148
Frame margins, borders, and scroll bars ......................148
Permitting or prohibiting user modifications ......................150
Targeting Links to Frames ............................151
Nested Framesets ..........................154
Inline Frames .............................................155
Summary .................................158
Chapter 11: Forms
Understanding Forms ...................................159
Inserting a Form ................................162
HTTP GET ..............................163
HTTP POST ...................................163
Additional <form> attributes ......................163
Field Labels ..............................164
Text Input Boxes ...........................164
Password Input Boxes ...........................165
Radio Buttons ..................................165
Check Boxes ........................................166
List Boxes .....................................167
Large Text Input ......................169
Hidden Fields ......................170
Buttons .........................................171
Images ......................................172
File Fields ..................................172
Submit and Reset Buttons ...........................174
Tab Order and Keyboard Shortcuts ......................174
Preventing Changes ..................................175
Fieldsets and Legends ....................................177
Using Events with Forms ................................179
Form Scripts and Script Services .............................182
Download a handler ....................183
Use a script service ...........................183
Summary ................................183
Chapter 12: Colors and Images
Web Color Basics ...................................185
Other Means to Specify Colors .....................................186
The Evolution of Color on the Web .......................................187
Using Proper Means to Specify Colors ............................191
Image Formats for the Web ..........................................193
Image compression ...............................193
Compression options .........................194
GIF .........................................194
JPEG .........................................195
PNG ......................................195
Creating Graphics ....................................196
Essential functions ...........................196
Progressive JPEGs and interlaced GIFs .............................197
Using transparency ......................................198
Animated images ..........................199
Inserting an Image .......................................200
Image Alignment ............................................201
Specifying Text to Display for Nongraphical Browsers .................204
Sizing an Image ...................................205
Image Borders ..........................................206
Image Maps ...........................................208
Specifying an image map ........................208
Specifying clickable regions .........................209
Specifying regions using anchor tags ........................211
Specifying regions using area tags .............................211
Putting it all together .......................................211
Summary .................212
Chapter 13:Multimedia
Animated Images ......................................214
Animation and Video Formats, Plug-ins, and Players .....................216
Popular formats and players (plug-ins) .........................217
Flash ........................................218
RealOne ..........................................218
QuickTime .......................................218
YouTube ....................218
Windows Media Player ......................................218
Embedding Media via the Object Tag ..............................219
Embedding a Windows Media Player Using <object> ........................223
Embedding YouTube Videos .......................................226
Adding Sound to Web Pages .........................228
Creating Multimedia Files .................................229
A Final Word About Multimedia ......................229
Summary ..........................................230
Chapter 14: Special Characters
Understanding Character Encodings ............231
Special Characters .......................232
En and Em Spaces and Dashes ...................233
Copyright and Trademark Symbols ..........234
Currency Symbols ............................235
‘‘Real’’ Quotation Marks ..............235
Arrows ..................236
Accented Characters .........................237
Greek and Mathematical Characters .................239
Other Useful Entities ....................243
Summary .............................245
Chapter 15: Internationalization and Localization
Internationalization and Localization ................247
Translating Your Web Site .......................................249
Understanding Unicode .................................249
Basic Latin (U + 0000–U + 007F) ........249
ISO-8859-1 .........................................254
Latin-1 Supplement (U + 00 C0 - U + 00FF) .............254
Latin Extended-A (U + 0100 - U + 017F) .........259
Latin Extended-B and Latin Extended Additional ..........260
Summary ..............................260
Chapter 16: Scripts
Client-Side versus Server-Side Scripting ....................261
Client-side scripting ..........................261
Server-side scripting ..........................262
Setting the Default Scripting Language .....................262
Including a Script .............................................263
Calling an External Script ...............264
Triggering Scripts with Events .................................264
Hiding Scripts from Older Browsers .......................269
Summary .......................270
Chapter 17: Dynamic HTML
The Need for DHTML .......................271
How DHTML Works ......................272
The Document Object Model ......................272
The history of the DOM ........................273
Understanding the DOM ..................273
DOM node properties and methods ....................275
Traversing and changing a document’s nodes .....278
The JavaScript DOM .......................280
The window object ...............281
The document object ..........................283
The form object .................284
The location object .................................284
The history object .......................285
The self object .................285
Using Event Handlers ..........................286
Accessing an Element by Its ID .......................287
Cross-Browser Compatibility Issues ....................288
Browser detection: querying for identification ........................288
Browser detection: object detection .........289
DHTML Examples ................................289
Form Automation: Check boxes ................289
Rollovers ...........................291
Collapsible menus .............................292
How they work ...............293
Summary .................295
Chapter 18: The Future of HTML: HTML5
More Publishing and Layout Features .................297
Accessible Multimedia ................................298
Changes: Elements and Attributes ..............300
New elements ............................301
New attributes by element ...............................301
New input types (form input element) ...........302
New global attributes...........303
Deprecated elements ..........................303
Deprecated attributes ................304
Summary ......................305
Part II: HTML Tools and Variants
Chapter 19:Web Development Software
Text-Oriented Editors .................309
Simple text editors .....................309
Smart text editors ...................310
HTML-specific editors .........311
WYSIWYG HTML Editors .....................312
NetObjects Fusion ..................312
Dreamweaver .............314
Firefox Add-ons .............316
Other Tools .......................317
Graphics editors ........317
Adobe Flash ................318
Summary ...................319
Chapter 20: Publishing Your Site
Introducing FTP .....................321
FTP Clients .................322
Notable FTP Clients .................325
Principles of Web Server File Organization ...........326
Summary .................327
Chapter 21: An Introduction To XML
XML Basics ............................329
XML Syntax ..............................331
XML Declaration and DOCTYPE ..........331
Elements ..................332
Attributes .......................333
Comments ...............334
Non-parsed data ................334
Entities ..............335
Namespaces ...................336
Stylesheets .......................337
Working with Document Type Definitions ..................337
Using elements in DTDs ................338
Using element declaration syntax for empty elements ..........339
Using element declaration syntax for elements with PCDATA ...........339
Using element declaration syntax for elements with child elements ......339
Declaring the number of occurrences for elements ......339
Using attributes in DTDs ....................342
Using PCDATA and CDATA in DTDs .................342
Introducing XML Schemas ..............343
Working with Schemas ..........343
Using XML ................................345
Extensible Stylesheet Language Transformations ......346
XML editing ....................346
XML parsing ................347
Summary ...................347
Chapter 22: Creating Mobile Documents
Understanding the Evolution of the Mobile Web ........350
The first, dark years of mobility .....................350
The Open Mobile Alliance and other standards ..........351
The bottom line .................351
XHTML Basic 1.1 ..................352
The XHTML Basic 1.1 doctype ............352
XHTML Basic 1.1 elements ...............352
Special considerations ..............................353
Screen size ......................354
Balancing content for bandwidth and cost ..............354
Input restrictions ..........354
Easy URLs ...........355
Small images ..........356
Descriptive alt attributes and link text .............356
Reliable navigation schemes ....................356
Limit complex display structures ....................356
Mobile Web Development Tools ..........356
Summary ................................357
Chapter 23: Tidying and Validating Your Documents
Tidying Your HTML Code ................359
HTML Tidy ...................362
Getting HTML Tidy .............................362
Running HTML Tidy .............363
Validating Your Code .......................365
Specifying the correct document type declaration .................365
Validation tools ..................366
Understanding validation output ................367
Additional Testing and Validation ..............368
Testing with a variety of user agents..............368
Testing for a variety of displays .................368
Summary .......................369
Chapter 24: HTML Tips and Tricks
Preloading Images .......................371
Controlling Text Breaks in Table Cells ......................373
Stretching Title Bars ................................374
Simulating Newspaper Columns ....................377
Including Image Size for Fast Display ................379
Protecting E-mail Addresses ......................379
Automating Forms ..........................382
Manipulating form objects ................382
Validating form input .................384
Modifying the User Agent Environment ............387
The concept .............................387
The implementation ......................387
The JavaScript functions ..............392
Summary .......................393
Part III: Controlling Presentation with CSS
Chapter 25: CSS Basics
The Purpose of Styles ............................397
Styles and HTML .............................398
CSS Levels 1, 2, and 3 ..............................400
Defining Styles ..................................400
Cascading Styles .................................402
Summary ..............................404
Chapter 26: Style Definitions
The Style Definition Format ..................405
Understanding Selectors ...........................407
Matching elements by type ....................407
Matching using the universal selector ..........407
Matching elements by class .....................408
Matching elements by identifier ................409
Matching elements by specific attributes ...............409
Matching child, descendant, and adjacent sibling elements ........410
Understanding document hierarchy ..........410
Selecting by hierarchy ...............411
Understanding Style Inheritance ..................412
Using Pseudo-Classes ...................413
Anchor styles ....................413
The :first-child pseudo-class ....................414
The :lang pseudo-class ..................414
Pseudo-Elements .........................415
First line .........................415
First letter .............................416
Before and after .........................417
Shorthand Expressions ...................418
Summary .......................420
Chapter 27: CSS Values and Units
General Property Value Rules .................421
Property Value Metrics ..................423
Keyword values ..............................424
Real-world measures .........................425
Screen measures ...................426
Relational measures ....................426
Color and URL functions ..........428
Aural metrics ..................429
Summary ......................430
Chapter 28: CSS Inheritance and Cascade
Inheritance .........................431
Cascade .................................433
Specificity ............435
Summary .................436
Chapter 29: Font Properties
Understanding Fonts .......................437
Font Types ........................438
Font Sizing ...................................440
Font Styling .......................441
Line Spacing ........................442
Embedding Fonts in a Document .................442
Summary .............................444
Chapter 30: Text Formatting
Aligning Text ..................................445
Controlling horizontal alignment ...............445
Controlling vertical alignment ........................448
Indenting Text .........................450
Controlling White Space Within Text ................451
Clearing floating objects .......................451
The white-space property ........................454
Controlling Letter and Word Spacing ............455
Specifying Capitalization ....................457
Using Text Decorations ..................458
Autogenerated Text ..........................460
Using CSS Table Properties ...................460
Controlling Table Attributes .......................460
Table borders ..........................461
Table border spacing ......................462
Collapsing borders .........................464
Borders on empty cells .......................465
Table Layout ...................467
Aligning and Positioning Captions ..............468
Summary ...............................470
Chapter 31: CSS Lists
An Overview of Lists ..............................471
CSS Lists — Any Element Will Do ......................472
List Style Type .....................................473
Positioning of Markers ..............................475
Using Images as List Markers ...........................476
Summary ..............................478
Chapter 32: Padding, Margins, and Borders
The CSS Box Formatting Model ...................479
Element Padding .................................482
Element Borders .........................483
Border width ......................483
Border style .................................484
Border color ......................................485
Border property shortcuts ......................486
Border spacing ..........................487
Element Margins .................................487
Dynamic Outlines ......................489
Summary ................................490
Chapter 33: Colors and Backgrounds
Element Colors ................................491
Foreground colors ............................491
Background colors ..............................492
Background Images .........................496
Repeating and scrolling images ................498
Positioning background images ..................501
The background shortcut property ..................502
Summary ........................502
Chapter 34: CSS Layouts
Understanding CSS Positioning .........................503
Static positioning ............................503
Relative positioning ...........................504
Absolute positioning ......................506
Fixed positioning .........................507
Specifying the Element Position ...................508
Floating Elements to the Left or Right ...............511
Defining an Element’s Width and Height .......................514
Specifying exact sizes ........................514
Specifying maximum and minimum sizes .............515
Controlling element overflow ........................515
Stacking Elements in Layers .......................517
Controlling Element Visibility ......................522
Summary ..............................523
Chapter 35: Pseudo-Elements and Generated Content
The Content Property ...........................525
Pseudo-Elements ..............................527
:first-line ........................528
:first-letter ........................528
:before and :after .................530
Quotation Marks ......................531
Numbering Elements Automatically ................532
The counter object ...........................532
Changing the counter value ...................532
A counter example: chapter and section numbers ...................533
Custom list numbers .............................536
Summary ..............................536
Chapter 36: Dynamic HTML with CSS
Accessing CSS Properties with JavaScript ......................539
Useful CSS Manipulation .......................545
Hiding and showing text .................545
Picture zooming ......................................548
Menu buttons with rollovers .............................549
Summary ..................................552
Chapter 37: Media Styles and Defining Documents for Printing
Understanding CSS Media Types .........................553
Specifying media types ................................554
Specifying one style’s media type ........................554
Specifying a group of styles’ media type..............555
Specifying an external style sheet’s media type ................556
Setting Up Documents for Printing ...................556
The page box formatting model ...........................556
Defining the page size with the @page rule .................557
Setting up the page size with the size property .............559
Setting margins with the margin property .............559
Including crop and cross marks .......................560
Controlling page breaks .........................560
Using the page-break-before and page-break-after properties ................560
Using the page-break-inside property ................562
Handling widows and orphans ........................562
Preparing documents for double-sided printing ........................564
Creating a Multimedia Document .......................................564
The online (screen media) document ......................565
Reformatting the page ...............................................568
Summary ..........................................................570
Chapter 38: The Future of CSS: CSS3
Just Better ..................................................571
Modularity ............................................................572
Using CSS3 Properties Today ...................................573
More Control over Selections .........................................574
Revisiting the Brass Ring of CSS: Rounded Corners ....................575
Summary .......................................577
Part IV: Additional CSS Tools
Chapter 39: User Interface Styles
Changing the Cursor ............................................581
User Interface Colors ..........................................583
User Interface Fonts .....................................................587
Summary ...............................................587
Chapter 40: Testing and Validating CSS
Testing Syntax As You Create Styles ...............................589
A Word About Formatting ................................591
Validating CSS ...................................................591
Firefox Add-ons for CSS Editing ..................592
Summary .........................................................593
Chapter 41: CSS Tips and Tricks
Hanging Indents ..............................................595
Expanding Buttons ...........................597
Pull Quotes ............................................600
Tabbed Menus ....................................603
Rounded Boxes ...................................608
Flowing Text ..................................615
Appendix A: XHTML Element Quick Reference
Element Listings ...........................618
<a> ..............618
Context ..................................618
Attributes ......................................618
Usage example ..................619
<abbr> .....................................................................................................................619
Context ............................................................................................................619
Attributes .........................................................................................................619
Usage example .................................................................................................619
<acronym> ...............................................................................................................620
Context ............................................................................................................620
Attributes .........................................................................................................620
Usage example .................................................................................................620
<address> .................................................................................................................620
Context ............................................................................................................620
Attributes .........................................................................................................621
Usage example .................................................................................................621
<area> ......................................................................................................................621
Context ............................................................................................................621
Attributes .........................................................................................................621
Usage example .................................................................................................621
<b> ...........................................................................................................................621
Context ............................................................................................................622
Attributes .........................................................................................................622
Usage example .................................................................................................622
<base> ......................................................................................................................622
Context ............................................................................................................622
Attributes .........................................................................................................622
Usage example .................................................................................................622
<bdo> ......................................................................................................................623
Context ............................................................................................................623
Attributes .........................................................................................................623
Usage example .................................................................................................623
<big> ........................................................................................................................623
Context ............................................................................................................623
Attributes .........................................................................................................623
Usage example .................................................................................................624
<blockquote> ...........................................................................................................624
Context ............................................................................................................624
Attributes .........................................................................................................624
Usage example .................................................................................................624
<body> .....................................................................................................................624
Context ............................................................................................................625
Attributes .........................................................................................................625
Usage example .................................................................................................625
<br> .........................................................................................................................625
Context ............................................................................................................625
Attributes .........................................................................................................625
Usage example .................................................................................................626
<button> ..................................................................................................................626
Context ............................................................................................................626
Attributes .........................................................................................................626
Usage example .................................................................................................626
<caption> .................................................................................................................627
Context ............................................................................................................627
Attributes .........................................................................................................627
Usage example .................................................................................................627
<cite> .......................................................................................................................627
Context ............................................................................................................627
Attributes .........................................................................................................627
Usage Example ................................................................................................627
<code> .....................................................................................................................628
Context ............................................................................................................628
Attributes .........................................................................................................628
Usage Example ................................................................................................628
<col> ........................................................................................................................628
Context ............................................................................................................628
Attributes .........................................................................................................628
Usage example .................................................................................................629
<colgroup> ..............................................................................................................629
Context ............................................................................................................629
Attributes .........................................................................................................629
Usage example .................................................................................................629
<dd> ........................................................................................................................629
Context ............................................................................................................629
Attributes .........................................................................................................629
Usage example .................................................................................................630
<del> ........................................................................................................................630
Context ............................................................................................................630
Attributes .........................................................................................................630
Usage example .................................................................................................630
<dfn> .......................................................................................................................630
Context ............................................................................................................630
Attributes .........................................................................................................630
Usage example .................................................................................................631
<div> ........................................................................................................................631
Context ............................................................................................................631
Attributes .........................................................................................................631
Usage example .................................................................................................631
<dl> .........................................................................................................................631
Context ............................................................................................................631
Attributes .........................................................................................................631
Usage example .................................................................................................632
<dt> .........................................................................................................................632
Context ............................................................................................................632
Attributes .........................................................................................................632
Usage example .................................................................................................632
<em> ........................................................................................................................632
Context ............................................................................................................632
Attributes .........................................................................................................633
Usage example .................................................................................................633
<fieldset> .................................................................................................................633
Context ............................................................................................................633
Attributes .........................................................................................................633
Usage example .................................................................................................633
<form> .....................................................................................................................633
Context ............................................................................................................634
Attributes .........................................................................................................634
Usage example .................................................................................................634
<h1>, <h2>, <h3>, <h4>, <h5>, <h6> ........................................................634
Context ............................................................................................................634
Attributes .........................................................................................................635
Usage example .................................................................................................635
<head> .....................................................................................................................635
Context ............................................................................................................635
Attributes .........................................................................................................635
Usage example .................................................................................................635
<hr> .........................................................................................................................636
Context ............................................................................................................636
Attributes .........................................................................................................636
Usage example .................................................................................................636
<html> .....................................................................................................................636
Context ............................................................................................................636
Attributes .........................................................................................................636
Usage example .................................................................................................636
<i> ............................................................................................................................637
Context ............................................................................................................637
Attributes .........................................................................................................637
Usage example .................................................................................................637
<img> .......................................................................................................................637
Context ............................................................................................................637
Attributes .........................................................................................................637
Usage example .................................................................................................638
<input> ....................................................................................................................638
Context ............................................................................................................638
Attributes .........................................................................................................638
Usage example .................................................................................................639
<ins> ........................................................................................................................639
Context ............................................................................................................639
Attributes .........................................................................................................639
Usage example .................................................................................................639
<kbd> ......................................................................................................................640
Context ............................................................................................................640
Attributes .........................................................................................................640
Usage example .................................................................................................640
<label> .....................................................................................................................640
Context ............................................................................................................640
Attributes .........................................................................................................640
Usage example .................................................................................................640
<legend> ..................................................................................................................641
Context ............................................................................................................641
Attributes .........................................................................................................641
Usage example .................................................................................................641
<li> ...........................................................................................................................641
Context ............................................................................................................641
Attributes .........................................................................................................641
Usage example .................................................................................................642
<link> ......................................................................................................................642
Context ............................................................................................................642
Attributes .........................................................................................................642
Usage example .................................................................................................642
<map> ......................................................................................................................643
Context ............................................................................................................643
Attributes .........................................................................................................643
Usage example .................................................................................................643
<meta> .....................................................................................................................643
Context ............................................................................................................643
Attributes .........................................................................................................644
Usage example .................................................................................................644
<noscript> ................................................................................................................644
Context ............................................................................................................644
Attributes .........................................................................................................644
Usage example .................................................................................................644
<object> ...................................................................................................................645
Context ............................................................................................................645
Attributes .........................................................................................................645
Usage example .................................................................................................645
<ol> ..........................................................................................................................646
Context ............................................................................................................646
Attributes .........................................................................................................646
Usage example .................................................................................................646
<optgroup> ..............................................................................................................646
Context ............................................................................................................646
Attributes .........................................................................................................647
Usage example .................................................................................................647
<option> ..................................................................................................................647
Context ............................................................................................................647
Attributes .........................................................................................................647
Usage example .................................................................................................647
<p> ..........................................................................................................................647
Context ............................................................................................................648
Attributes .........................................................................................................648
Usage example .................................................................................................648
<param> ..................................................................................................................648
Context ............................................................................................................648
Attributes .........................................................................................................648
Usage example .................................................................................................649
<pre> .......................................................................................................................649
Context ............................................................................................................649
Attributes .........................................................................................................649
Usage example .................................................................................................649
<q> ...........................................................................................................................649
Context ............................................................................................................649
Attributes .........................................................................................................650
Usage example .................................................................................................650
<samp> ....................................................................................................................650
Context ............................................................................................................650
Attributes .........................................................................................................650
Usage example .................................................................................................650
<script> ....................................................................................................................650
Context ............................................................................................................651
Attributes .........................................................................................................651
Usage example .................................................................................................651
<select> ....................................................................................................................651
Context ............................................................................................................651
Attributes .........................................................................................................652
Usage example .................................................................................................652
<small> ....................................................................................................................652
Context ............................................................................................................653
Attributes .........................................................................................................653
Usage example .................................................................................................653
<span> .....................................................................................................................653
Context ............................................................................................................653
Attributes .........................................................................................................653
Usage example .................................................................................................653
<strong> ...................................................................................................................653
Context ............................................................................................................654
Attributes .........................................................................................................654
Usage example .................................................................................................654
<style> .....................................................................................................................654
Context ............................................................................................................654
Attributes .........................................................................................................654
Usage example .................................................................................................654
<sub> .......................................................................................................................655
Context ............................................................................................................655
Attributes .........................................................................................................655
Usage example .................................................................................................655
<sup> .......................................................................................................................655
Context ............................................................................................................655
Attributes .........................................................................................................655
Usage example .................................................................................................655
<table> .....................................................................................................................656
Context ............................................................................................................656
Attributes .........................................................................................................656
Usage example .................................................................................................656
<tbody> ...................................................................................................................657
Context ............................................................................................................657
Attributes .........................................................................................................657
Usage example .................................................................................................657
<td> .........................................................................................................................657
Context ............................................................................................................657
Attributes .........................................................................................................658
Usage example .................................................................................................658
<textarea> ................................................................................................................658
Context ............................................................................................................658
Attributes .........................................................................................................658
Usage example .................................................................................................659
<tfoot> .....................................................................................................................659
Context ............................................................................................................659
Attributes .........................................................................................................659
Usage example .................................................................................................659
<th> .........................................................................................................................659
Context ............................................................................................................660
Attributes .........................................................................................................660
Usage example .................................................................................................660
<thead> ....................................................................................................................660
Context ............................................................................................................660
Attributes .........................................................................................................661
Usage example .................................................................................................661
<title> .......................................................................................................................661
Context ............................................................................................................661
Attributes .........................................................................................................661
Usage example .................................................................................................661
<tr> ..........................................................................................................................661
Context ............................................................................................................662
Attributes .........................................................................................................662
Usage example .................................................................................................662
<tt> ..........................................................................................................................662
Context ............................................................................................................662
Attributes .........................................................................................................662
Usage example .................................................................................................662
<ul> .........................................................................................................................662
Context ............................................................................................................663
Attributes .........................................................................................................663
Usage example .................................................................................................663
<var> ........................................................................................................................663
Context ............................................................................................................663
Attributes .........................................................................................................663
Usage example .................................................................................................663
Event Attributes ...........................................664
Standard events ...........................................664
Other Events ......................................664
Other Common Attributes ..........................................665
Core attributes .........................................665
Internationalization attributes ....................665
Common color codes ..........................665
Appendix B: HTML Special Characters Quick Reference
Appendix C: CSS 2.1 Properties Quick Reference
Property Listings ............................679
Property List: Quick Reference ......................680
Background ..............................682
background-image ...........................................................................................682
background-repeat ..........................................................................................682
background-attachment ..................................................................................683
background-position .......................................................................................683
background-color ............................................................................................683
background ......................................................................................................684
List .............................................................................................................................684
list-style-type ...................................................................................................684
list-style-position .............................................................................................684
list-style-image .................................................................................................685
list-style ...........................................................................................................685
Generated content .....................................................................................................685
content .............................................................................................................685
quotes ..............................................................................................................686
counter-increment ...........................................................................................686
counter-reset ....................................................................................................686
Font and text .............................................................................................................686
text-align ..........................................................................................................686
text-decoration ................................................................................................687
text-indent .......................................................................................................687
text-transform ..................................................................................................687
color .................................................................................................................688
font-family .......................................................................................................688
font-size ...........................................................................................................688
font-style ..........................................................................................................689
font-variant ......................................................................................................689
font-weight ......................................................................................................689
font ..................................................................................................................690
letter-spacing ...................................................................................................690
word-spacing ...................................................................................................691
white-space ......................................................................................................691
Text direction ............................................................................................................691
unicode-bidi ....................................................................................................691
direction ..........................................................................................................692
Block ..........................................................................................................................692
margin-left, margin-right, margin-top, margin-bottom .................................692
margin .............................................................................................................692
padding-left, padding-right, padding-top, padding-bottom ..........................693
padding ............................................................................................................693
clip ...................................................................................................................693
overflow ...........................................................................................................694
height, width ...................................................................................................694
max-height, max-width ...................................................................................694
min-height, min-width ....................................................................................694
line-height .......................................................................................................695
vertical-align ....................................................................................................695
Positioning .................................................................................................................695
visibility ...........................................................................................................696
display .............................................................................................................696
position ............................................................................................................696
float ..................................................................................................................697
top, bottom, left, right ....................................................................................697
z-index .............................................................................................................697
clear .................................................................................................................698
Borders .......................................................................................................................698
border-color, border-top-color, border-bottom-color, border-left-color,
border-right-color .........................................................................................698
border-style, border-top-style, border-bottom-style, border-left-style,
border-right-style ..........................................................................................699
border-width, border-top-width, border-bottom-width, border-left-width,
border-right-width ........................................................................................699
border ..............................................................................................................699
outline-color ....................................................................................................700
outline-style .....................................................................................................700
outline-width ...................................................................................................700
outline ..............................................................................................................700
Table ..........................................................................................................................701
table-layout ......................................................................................................701
border-collapse ................................................................................................701
border-spacing .................................................................................................701
empty-cells ......................................................................................................702
caption-side .....................................................................................................702
Printing ......................................................................................................................702
page-break-after, page-break-before ...............................................................703
page-break-inside ............................................................................................703
orphans ............................................................................................................703
widows ............................................................................................................703
Miscellaneous ............................................................................................................704
cursor ...............................................................................................................704
Appendix D: CSS 2.1 Selectors Quick Reference 
Basic Element Selectors .....................705
Descendant Selectors ..................................706
Child Selectors ..........................................706
Adjacent Sibling Selectors .........................707
Class Selectors ............................707
ID Selectors .....................................707
Attribute Selectors ............................................708
Appendix E: Pseudo-Elements and Pseudo-Classes
Quick Reference . . . . . . . . . . . . . . . 709
Pseudo-Elements ....................................710
Pseudo-Classes ......................................710
Index . . . . . . . . . . . . . . . . 711

  ●▬▬▬▬▬❂❂❂▬▬▬▬▬●
●▬▬❂❂▬▬●
●▬❂▬●

═════ ═════