You are previewing Beginning Web Programming with HTML, XHTML, and CSS, Second Edition.
O'Reilly logo
Beginning Web Programming with HTML, XHTML, and CSS, Second Edition

Book Description

This beginning guide reviews HTML and also introduces you to using XHTML for the structure of a web page and cascading style sheets (CSS) for controlling how a document should appear on a web page. You?ll learn how to take advantage of the latest features of browsers while making sure that your pages still work in older, but popular, browsers. By incorporating usability and accessibility, you?ll be able to write professional-looking and well-coded web pages that use the latest technologies.

Table of Contents

  1. Copyright
  2. About the Author
  3. About the Technical Editor
  4. Credits
  5. Introduction
    1. About the Book
    2. Whom This Book Is For
    3. What This Book Covers
    4. What You Need to Use This Book
    5. How This Book Is Organized
    6. Conventions
    7. Source Code
    8. Errata
    9. p2p.wrox.com
  6. 1. Creating Structured Documents
    1. 1.1. A Web of Structured Documents
    2. 1.2. Introducing XHTML
      1. 1.2.1. Tags and Elements
        1. 1.2.1.1. Separating Heads from Bodies
        2. 1.2.1.2. Attributes Tell Us About Elements
        3. 1.2.1.3. The XML Declaration
        4. 1.2.1.4. Document Type Declaration
    3. 1.3. Core Elements and Attributes
      1. 1.3.1. The <html> Element
      2. 1.3.2. The <head> Element
      3. 1.3.3. The <title> Element
      4. 1.3.4. The <body> Element
    4. 1.4. Attribute Groups
      1. 1.4.1. Core Attributes
        1. 1.4.1.1. The id Attribute
        2. 1.4.1.2. The class Attribute
        3. 1.4.1.3. The title Attribute
        4. 1.4.1.4. The style Attribute (deprecated)
      2. 1.4.2. Internationalization
        1. 1.4.2.1. The dir Attribute
        2. 1.4.2.2. The lang Attribute
        3. 1.4.2.3. The xml:lang Attribute
      3. 1.4.3. UI Events
    5. 1.5. Basic Text Formatting
      1. 1.5.1. White Space and Flow
      2. 1.5.2. Creating Headings Using hn Elements
        1. 1.5.2.1. The align Attribute (deprecated)
      3. 1.5.3. Creating Paragraphs Using the <p> Element
      4. 1.5.4. Creating Line Breaks Using the <br /> Element
      5. 1.5.5. Creating Preformatted Text Using the <pre> Element
    6. 1.6. Presentational Elements
      1. 1.6.1. The <b> Element
      2. 1.6.2. The <i> Element
      3. 1.6.3. The <u> Element (deprecated)
      4. 1.6.4. The <s> and <strike> Elements (deprecated)
      5. 1.6.5. The <tt> Element
      6. 1.6.6. The <sup> Element
      7. 1.6.7. The <sub> Element
      8. 1.6.8. The <big> Element
      9. 1.6.9. The <small> Element
      10. 1.6.10. The <hr /> Element
    7. 1.7. Phrase Elements
      1. 1.7.1. The <em> Element Adds Emphasis
      2. 1.7.2. The <strong> Element Adds Strong Emphasis
      3. 1.7.3. The <abbr> Element Is for Abbreviations
      4. 1.7.4. The <acronym> Element Is for Acronym Use
      5. 1.7.5. The <dfn> Element Is for Special Terms
      6. 1.7.6. The <blockquote> Element Is for Quoting Text
        1. 1.7.6.1. Using the cite Attribute with the <blockquote> Element
      7. 1.7.7. The <q> Element Is for Short Quotations
      8. 1.7.8. The <cite> Element Is for Citations
      9. 1.7.9. The <code> Element Is for Code
      10. 1.7.10. The <kbd> Element Is for Text Typed on a Keyboard
      11. 1.7.11. The <var> Element Is for Programming Variables
      12. 1.7.12. The <samp> Element Is for a Program Output
      13. 1.7.13. The <address> Element Is for Addresses
    8. 1.8. Lists
      1. 1.8.1. Using the <ul> Element to Create Unordered Lists
      2. 1.8.2. Ordered Lists
        1. 1.8.2.1. Using the type Attribute to Select Numbers, Letters, or Roman Numerals in Ordered Lists (deprecated)
        2. 1.8.2.2. Using the start Attribute to Change the Starting Number in Ordered Lists (deprecated)
      3. 1.8.3. Definition Lists
      4. 1.8.4. Nesting Lists
    9. 1.9. Editing Text
      1. 1.9.1. Using <ins> to Indicate New Additions to Text
      2. 1.9.2. Using <del> to Indicate Deleted Text
    10. 1.10. Using Character Entities for Special Characters
    11. 1.11. Comments
    12. 1.12. The <font> Element (deprecated)
    13. 1.13. Understanding Block and Inline Elements
    14. 1.14. Grouping Elements with <div> and <span>
    15. 1.15. Summary
    16. 1.16. Exercises
  7. 2. Links and Navigation
    1. 2.1. Basic Links
      1. 2.1.1. Linking to Other Documents
      2. 2.1.2. Linking to E-mail Addresses
    2. 2.2. Understanding Directories and Directory Structures
      1. 2.2.1. What Are You Linking To?
      2. 2.2.2. What a URL Is Made Up Of
        1. 2.2.2.1. The Scheme
        2. 2.2.2.2. The Host Address
        3. 2.2.2.3. The Filepath
        4. 2.2.2.4. Other Parts of the URL
      3. 2.2.3. Absolute and Relative URLs
        1. 2.2.3.1. Same Directory
        2. 2.2.3.2. Subdirectory
        3. 2.2.3.3. Parent Directory
        4. 2.2.3.4. From the Root
        5. 2.2.3.5. Default Files
      4. 2.2.4. The <base> Element
    3. 2.3. Creating Links with the <a> Element
      1. 2.3.1. Creating a Source Anchor with the href Attribute
      2. 2.3.2. Creating a Destination Anchor Using the name and id Attributes (linking to a specific part of a page)
        1. 2.3.2.1. The <a> Element's Other Attributes
          1. 2.3.2.1.1. The accesskey Attribute
          2. 2.3.2.1.2. The charset Attribute
          3. 2.3.2.1.3. The coords Attribute
          4. 2.3.2.1.4. The hreflang Attribute
          5. 2.3.2.1.5. The rel Attribute
          6. 2.3.2.1.6. The rev Attribute
          7. 2.3.2.1.7. The shape Attribute
          8. 2.3.2.1.8. The tabindex Attribute
          9. 2.3.2.1.9. The target Attribute
          10. 2.3.2.1.10. The title Attribute
          11. 2.3.2.1.11. The type Attribute
    4. 2.4. Advanced E-mail Links
    5. 2.5. Summary
    6. 2.6. Exercises
  8. 3. Images and Objects
    1. 3.1. Adding Images to Your Site
      1. 3.1.1. Types of Image Formats
      2. 3.1.2. Bitmap Images
        1. 3.1.2.1. GIF Images
        2. 3.1.2.2. Animated GIFs
        3. 3.1.2.3. JPEG Images
        4. 3.1.2.4. PNG Images
        5. 3.1.2.5. Keeping File Sizes Small
      3. 3.1.3. Vector Images
      4. 3.1.4. Adding Images Using the <img> Element
        1. 3.1.4.1. The src Attribute
        2. 3.1.4.2. The alt Attribute
        3. 3.1.4.3. The align Attribute (deprecated)
        4. 3.1.4.4. The border Attribute (deprecated)
        5. 3.1.4.5. The height and width Attributes
        6. 3.1.4.6. The hspace and vspace Attributes (deprecated)
        7. 3.1.4.7. The ismap and usemap Attributes
        8. 3.1.4.8. The longdesc Attribute
        9. 3.1.4.9. The name Attribute (deprecated)
    2. 3.2. Adding Other Objects with the <object> Element
      1. 3.2.1. The <object> Element's Attributes
        1. 3.2.1.1. The archive Attribute
        2. 3.2.1.2. The border Attribute (deprecated)
        3. 3.2.1.3. The classid Attribute
        4. 3.2.1.4. The codebase Attribute
        5. 3.2.1.5. The codetype Attribute
        6. 3.2.1.6. The declare Attribute
        7. 3.2.1.7. The data Attribute
        8. 3.2.1.8. The height and width Attributes
        9. 3.2.1.9. The hspace and vspace attributes (deprecated)
        10. 3.2.1.10. The name Attribute (deprecated)
        11. 3.2.1.11. The standby Attribute
        12. 3.2.1.12. The tabindex Attribute
        13. 3.2.1.13. The usemap Attribute
      2. 3.2.2. The <param> Element
        1. 3.2.2.1. The name and value Attributes
        2. 3.2.2.2. The valuetype Attribute
        3. 3.2.2.3. The type Attribute
      3. 3.2.3. Adding a Flash Movie To A Page
    3. 3.3. Using Images as Links
    4. 3.4. Image Maps
      1. 3.4.1. Server-Side Image Maps
      2. 3.4.2. Client-Side Image Maps
        1. 3.4.2.1. Client-Side Image Maps Using <map> and <area>
          1. 3.4.2.1.1. The shape Attribute
          2. 3.4.2.1.2. The coords Attribute
          3. 3.4.2.1.3. The href and nohref Attributes
          4. 3.4.2.1.4. The alt Attribute
          5. 3.4.2.1.5. The target Attribute
          6. 3.4.2.1.6. The tabindex Attribute
        2. 3.4.2.2. Client-Side Image Maps Using the <object> Element
    5. 3.5. Summary
    6. 3.6. Exercises
  9. 4. Tables
    1. 4.1. Introducing Tables
    2. 4.2. Basic Table Elements and Attributes
      1. 4.2.1. The <table> Element Creates a Table
        1. 4.2.1.1. The align Attribute (deprecated)
        2. 4.2.1.2. The bgcolor Attribute (deprecated)
        3. 4.2.1.3. The border Attribute (deprecated)
        4. 4.2.1.4. The cellpadding Attribute (deprecated)
        5. 4.2.1.5. The cellspacing Attribute (deprecated)
        6. 4.2.1.6. The dir Attribute
        7. 4.2.1.7. The frame Attribute (deprecated)
        8. 4.2.1.8. The rules Attribute (deprecated)
        9. 4.2.1.9. The summary Attribute
        10. 4.2.1.10. The width Attribute (deprecated)
      2. 4.2.2. The <tr> Element Contains Table Rows
        1. 4.2.2.1. The align Attribute (deprecated)
        2. 4.2.2.2. The bgcolor Attribute (deprecated)
        3. 4.2.2.3. The char Attribute
        4. 4.2.2.4. The charoff Attribute
        5. 4.2.2.5. The valign Attribute (deprecated)
      3. 4.2.3. The <td> and <th> Elements Represent Table Cells
        1. 4.2.3.1. The abbr Attribute
        2. 4.2.3.2. The align Attribute (deprecated)
        3. 4.2.3.3. The axis Attribute
        4. 4.2.3.4. The bgcolor Attribute (deprecated)
        5. 4.2.3.5. The char Attribute
        6. 4.2.3.6. The charoff Attribute
        7. 4.2.3.7. The colspan Attribute
        8. 4.2.3.8. The headers Attribute
        9. 4.2.3.9. The height Attribute (deprecated)
        10. 4.2.3.10. The nowrap Attribute (deprecated)
        11. 4.2.3.11. The rowspan Attribute
        12. 4.2.3.12. The scope Attribute
        13. 4.2.3.13. The valign Attribute (deprecated)
        14. 4.2.3.14. The width Attribute (deprecated)
    3. 4.3. Advanced Tables
      1. 4.3.1. Splitting Up Tables Using a Head, Body, and Foot
        1. 4.3.1.1. The align Attribute (deprecated)
        2. 4.3.1.2. The char Attribute
        3. 4.3.1.3. The charoff Attribute
        4. 4.3.1.4. The valign Attribute (deprecated)
      2. 4.3.2. Adding a <caption> to a Table
      3. 4.3.3. Spanning Columns Using the colspan Attribute
      4. 4.3.4. Spanning Rows Using the rowspan Attribute
      5. 4.3.5. Grouping Columns Using the <colgroup> Element
        1. 4.3.5.1. The align Attribute (deprecated)
        2. 4.3.5.2. The char Attribute
        3. 4.3.5.3. The charoff Attribute
        4. 4.3.5.4. The span Attribute
        5. 4.3.5.5. The valign Attribute (deprecated)
        6. 4.3.5.6. The width Attribute
      6. 4.3.6. Columns Sharing Styles Using the <col> Element
    4. 4.4. Accessibility Issues with Tables
      1. 4.4.1. How Tables Linearize
      2. 4.4.2. Linearization of Tables Used for Layout
      3. 4.4.3. Linearization of Tables Used for Data
    5. 4.5. Summary
    6. 4.6. Exercises
  10. 5. Forms
    1. 5.1. Introducing Forms
    2. 5.2. Creating a Form with the <form> Element
      1. 5.2.1. The action Attribute
      2. 5.2.2. The method Attribute
      3. 5.2.3. The id Attribute
      4. 5.2.4. The name Attribute (deprecated)
      5. 5.2.5. The onsubmit Attribute
      6. 5.2.6. The onreset Attribute
      7. 5.2.7. The enctype Attribute
      8. 5.2.8. The accept-charset Attribute
      9. 5.2.9. The accept Attribute
      10. 5.2.10. The target Attribute
      11. 5.2.11. White Space and the <form> Element
    3. 5.3. Form Controls
      1. 5.3.1. Text Inputs
        1. 5.3.1.1. Single-Line Text Input Controls
        2. 5.3.1.2. Password Input Controls
        3. 5.3.1.3. Multiple-Line Text Input Controls
      2. 5.3.2. Buttons
        1. 5.3.2.1. Creating Buttons Using the <input> Element
        2. 5.3.2.2. Using Images for Buttons
        3. 5.3.2.3. Creating Buttons Using the <button> Element
      3. 5.3.3. Checkboxes
      4. 5.3.4. Radio Buttons
      5. 5.3.5. Select Boxes
        1. 5.3.5.1. The <select> Element
        2. 5.3.5.2. The <option> Element
        3. 5.3.5.3. Creating Scrolling Select Boxes
        4. 5.3.5.4. Selecting Multiple Options with the multiple Attribute
        5. 5.3.5.5. Grouping Options with the <optgroup> Element
        6. 5.3.5.6. Attributes for Select Boxes
      6. 5.3.6. File Select Boxes
      7. 5.3.7. Hidden Controls
      8. 5.3.8. Object Controls
    4. 5.4. Creating Labels for Controls and the <label> Element
    5. 5.5. Structuring Your Forms with <fieldset> and <legend> Elements
    6. 5.6. Focus
      1. 5.6.1. Tabbing Order
      2. 5.6.2. Access Keys
    7. 5.7. Disabled and Read-Only Controls
    8. 5.8. Sending Form Data to the Server
      1. 5.8.1. HTTP get
      2. 5.8.2. HTTP post
    9. 5.9. Summary
    10. 5.10. Exercises
  11. 6. Frames
    1. 6.1. Introducing the Frameset
    2. 6.2. When to Use Frames
    3. 6.3. The <frameset> Element
      1. 6.3.1. The cols Attribute
        1. 6.3.1.1. Absolute Values in Pixels
        2. 6.3.1.2. A Percentage of the Browser Window or Parent Frame
        3. 6.3.1.3. The Wildcard Symbol
        4. 6.3.1.4. Relative Widths Between Columns
        5. 6.3.1.5. Value Priorities and Resizing Windows
      2. 6.3.2. The rows Attribute
      3. 6.3.3. Browser-Specific Extensions to the <frameset> Element
        1. 6.3.3.1. The border Attribute
        2. 6.3.3.2. The frameborder Attribute
        3. 6.3.3.3. The framespacing Attribute
    4. 6.4. The <frame> Element
      1. 6.4.1. The src Attribute
      2. 6.4.2. The name Attribute
      3. 6.4.3. The frameborder Attribute
      4. 6.4.4. The marginwidth and marginheight Attributes
      5. 6.4.5. The noresize Attribute
      6. 6.4.6. The scrolling Attribute
      7. 6.4.7. The longdesc Attribute
    5. 6.5. The <noframes> Element
    6. 6.6. Creating Links Between Frames
      1. 6.6.1. Setting a Default Target Frame Using the <base> Element
    7. 6.7. Nested Framesets
    8. 6.8. Floating or Inline Frames with <iframe>
      1. 6.8.1. The <iframe> Element
        1. 6.8.1.1. The src Attribute
        2. 6.8.1.2. The align Attribute (deprecated)
        3. 6.8.1.3. The height and width Attributes
        4. 6.8.1.4. The frameborder Attribute
        5. 6.8.1.5. The longdesc Attribute
        6. 6.8.1.6. The marginheight and marginwidth Attributes
        7. 6.8.1.7. The scrolling Attribute
    9. 6.9. Summary
    10. 6.10. Exercises
  12. 7. Cascading Style Sheets
    1. 7.1. Introducing CSS
      1. 7.1.1. A Basic Example
      2. 7.1.2. Inheritance
    2. 7.2. Where You Can Add CSS Rules
      1. 7.2.1. The <link> Element
        1. 7.2.1.1. The rel Attribute
        2. 7.2.1.2. The type Attribute
        3. 7.2.1.3. The href Attribute
        4. 7.2.1.4. The hreflang Attribute
        5. 7.2.1.5. The media Attribute
      2. 7.2.2. The <style> Element
      3. 7.2.3. Advantages of External CSS Style Sheets
    3. 7.3. CSS Properties
    4. 7.4. Controlling Fonts
      1. 7.4.1. The font-family Property
      2. 7.4.2. The font-size Property
      3. 7.4.3. The font-weight Property
      4. 7.4.4. The font-style Property
      5. 7.4.5. The font-variant Property
      6. 7.4.6. The font-stretch Property
      7. 7.4.7. The font-size-adjust Property
    5. 7.5. Text Formatting
      1. 7.5.1. The color Property
      2. 7.5.2. The text-align Property
      3. 7.5.3. The vertical-align Property
      4. 7.5.4. The text-decoration Property
      5. 7.5.5. The text-indent Property
      6. 7.5.6. The text-shadow Property
      7. 7.5.7. The text-transform Property
      8. 7.5.8. The letter-spacing Property
      9. 7.5.9. The word-spacing Property
      10. 7.5.10. The white-space Property
      11. 7.5.11. The direction Property
      12. 7.5.12. The unicode-bidi Property
    6. 7.6. Text Pseudo-Classes
      1. 7.6.1. The first-letter Pseudo-Class
      2. 7.6.2. The first-line Pseudo-Class
    7. 7.7. Selectors
      1. 7.7.1. Universal Selector
      2. 7.7.2. The Type Selector
      3. 7.7.3. The Class Selector
      4. 7.7.4. The ID Selector
      5. 7.7.5. The Child Selector
      6. 7.7.6. The Descendent Selector
      7. 7.7.7. The Adjacent Sibling Selector
      8. 7.7.8. Using Child and Adjacent Sibling Selectors to Reduce Dependence on Classes in Markup
      9. 7.7.9. Attribute Selectors
    8. 7.8. Lengths
      1. 7.8.1. Absolute Units
      2. 7.8.2. Relative Units
        1. 7.8.2.1. px
        2. 7.8.2.2. em
        3. 7.8.2.3. ex
    9. 7.9. Percentages
    10. 7.10. Introducing the Box Model
      1. 7.10.1. An Example Illustrating the Box Model
      2. 7.10.2. The Border Properties
        1. 7.10.2.1. The border-color Property
        2. 7.10.2.2. The border-style Property
        3. 7.10.2.3. The border-width Property
        4. 7.10.2.4. Expressing Border Properties Using Shorthand
      3. 7.10.3. The padding Property
      4. 7.10.4. The margin Property
      5. 7.10.5. Dimensions
        1. 7.10.5.1. The height and width Properties
        2. 7.10.5.2. The line-height Property
        3. 7.10.5.3. The max-width and min-width Properties
        4. 7.10.5.4. The min-height and max-height Properties
        5. 7.10.5.5. The overflow Property
    11. 7.11. Summary
    12. 7.12. Exercises
  13. 8. More Cascading Style Sheets
    1. 8.1. Links
    2. 8.2. Backgrounds
      1. 8.2.1. The background-color Property
      2. 8.2.2. The background-image Property
      3. 8.2.3. The background-repeat Property
      4. 8.2.4. The background-position Property (for fixing position of backgrounds)
      5. 8.2.5. The background-attachment Property (for watermarks)
      6. 8.2.6. The background Property (the well-supported shorthand)
    3. 8.3. Lists
      1. 8.3.1. The list-style-type Property
      2. 8.3.2. The list-style-position Property
      3. 8.3.3. The list-style-image Property
      4. 8.3.4. The list-style Property (the shorthand)
      5. 8.3.5. The marker-offset Property
    4. 8.4. Tables
      1. 8.4.1. Table-Specific Properties
      2. 8.4.2. The border-collapse Property
      3. 8.4.3. The border-spacing Property
      4. 8.4.4. The caption-side Property
      5. 8.4.5. The empty-cells Property
      6. 8.4.6. The table-layout Property
    5. 8.5. Outlines
      1. 8.5.1. The outline-width Property
      2. 8.5.2. The outline-style Property
      3. 8.5.3. The outline-color Property
      4. 8.5.4. The outline Property (the shorthand)
    6. 8.6. The :focus and :active Pseudo-Classes
    7. 8.7. Generated Content
      1. 8.7.1. The :before and :after Pseudo-Elements
      2. 8.7.2. The content Property
        1. 8.7.2.1. Counters
        2. 8.7.2.2. Quotation Marks
    8. 8.8. Miscellaneous Properties
      1. 8.8.1. The cursor Property
      2. 8.8.2. The display Property
      3. 8.8.3. The visibility Property
    9. 8.9. Additional Rules
      1. 8.9.1. The @import Rule: Modularized Style Sheets
      2. 8.9.2. The @charset Rule
      3. 8.9.3. The !important Rule
    10. 8.10. Positioning with CSS
      1. 8.10.1. Normal Flow
      2. 8.10.2. The position Property
      3. 8.10.3. Box Offset Properties
      4. 8.10.4. Relative Positioning
      5. 8.10.5. Absolute Positioning
      6. 8.10.6. Fixed Positioning
      7. 8.10.7. The z-index Property
      8. 8.10.8. Floating Using the float Property
      9. 8.10.9. The clear Property
    11. 8.11. Summary
    12. 8.12. Exercises
  14. 9. Page Layout
    1. 9.1. Understanding the Site
      1. 9.1.1. Understanding a Site's Aims
      2. 9.1.2. Whom You Expect to Visit
      3. 9.1.3. New Content
      4. 9.1.4. Defining Your Site's Content
      5. 9.1.5. Grouping and Categorization
      6. 9.1.6. Creating a Site Map
      7. 9.1.7. Identifying Key Elements for Every Page
    2. 9.2. Page Size (and Screen Resolution)
      1. 9.2.1. Fixed-Width vs. Liquid Designs
        1. 9.2.1.1. Liquid Design
        2. 9.2.1.2. Fixed-Width Design
    3. 9.3. Designing Pages
      1. 9.3.1. Sketching the Placement of Elements
      2. 9.3.2. Introducing the Style
        1. 9.3.2.1. What Is Already Done for You?
        2. 9.3.2.2. Common Page Elements
        3. 9.3.2.3. The Influence of Images on Design
        4. 9.3.2.4. Grouping Elements
      3. 9.3.3. Navigation
        1. 9.3.3.1. Top Navigation
        2. 9.3.3.2. Left Navigation
        3. 9.3.3.3. Top and Left Navigation
        4. 9.3.3.4. Bottom Navigation
        5. 9.3.3.5. Right Navigation
      4. 9.3.4. Home Pages
      5. 9.3.5. Content Pages
    4. 9.4. Structuring Pages
      1. 9.4.1. Single-Column Layouts
      2. 9.4.2. Two-Column Layouts
      3. 9.4.3. Three-Column Layouts
      4. 9.4.4. Sacrificial Columns
      5. 9.4.5. Advanced Layout Using CSS
      6. 9.4.6. Creating a Layout Using Nested Tables
    5. 9.5. Summary
    6. 9.6. Exercises
  15. 10. Design Issues
    1. 10.1. Text
      1. 10.1.1. White Space Helps Make More Attractive Pages
      2. 10.1.2. Carefully Aligned Text Is More Readable
      3. 10.1.3. Adjusting Line Height Makes Text More Readable
      4. 10.1.4. Wide Columns of Text Are Harder to Read
      5. 10.1.5. Background Images Can Make Text Hard to Read
      6. 10.1.6. Choose Fonts Carefully
      7. 10.1.7. Fixed-Size Fonts Are Affected by Screen Resolution
    2. 10.2. Navigation
      1. 10.2.1. Menus
        1. 10.2.1.1. Menus Must Focus on What Visitors Want to Achieve
        2. 10.2.1.2. Menus Must Be Clearly Separated from Content
        3. 10.2.1.3. If You Use Icons to Represent a Link, Make Sure Everyone Will Understand Them
        4. 10.2.1.4. Menus Must Be Quick and Easy to Read
        5. 10.2.1.5. Grouping of Menu Items Must Be Logical
        6. 10.2.1.6. Menus Items Must Be Easy to Select
        7. 10.2.1.7. Menus Must Load Quickly
        8. 10.2.1.8. Menus Must Be Consistent Across a Site
      2. 10.2.2. Links
        1. 10.2.2.1. Text Links
        2. 10.2.2.2. Images as Links
      3. 10.2.3. Site Search Features
        1. 10.2.3.1. Search Features Make Sites More Usable
        2. 10.2.3.2. Adding a Google Search to Your Site
    3. 10.3. Shading Multiple Rows of a Table
    4. 10.4. Forms
      1. 10.4.1. Before Designing the Form
        1. 10.4.1.1. Listing Required Information First
        2. 10.4.1.2. Group-Related Information
        3. 10.4.1.3. Model Paper Forms Users Are Familiar With
        4. 10.4.1.4. Are Users Going to Provide the Same Information Each Time?
        5. 10.4.1.5. What Else Needs to Appear on the Form?
      2. 10.4.2. Designing the Form
        1. 10.4.2.1. Selecting the Type of Form Control
          1. 10.4.2.1.1. Radio Buttons and Checkboxes
          2. 10.4.2.1.2. Select Boxes
          3. 10.4.2.1.3. Text Boxes
        2. 10.4.2.2. Grouping Controls
          1. 10.4.2.2.1. Using <fieldset> Elements
          2. 10.4.2.2.2. Splitting a Form into Separate Pages
          3. 10.4.2.2.3. Number Questions
        3. 10.4.2.3. Layout of Forms
          1. 10.4.2.3.1. Labeling Controls
          2. 10.4.2.3.2. Using Tables for Layout
          3. 10.4.2.3.3. Keeping Relevant Information Next to or Above Form Controls
          4. 10.4.2.3.4. Required Information
          5. 10.4.2.3.5. Careful Placement of Buttons
          6. 10.4.2.3.6. Using the title Attribute on Form Controls
          7. 10.4.2.3.7. Tab Index
          8. 10.4.2.3.8. Don't Rely on Color to Convey Information
          9. 10.4.2.3.9. Using CSS with Form Elements
          10. 10.4.2.3.10. Testing the Form
    5. 10.5. Summary
    6. 10.6. Exercises
  16. 11. Learning JavaScript
    1. 11.1. What Is Programming About?
    2. 11.2. How to Add a Script to Your Pages
      1. 11.2.1. Comments in JavaScript
      2. 11.2.2. The <noscript> Element
    3. 11.3. The Document Object Model
      1. 11.3.1. Introducing the Document Object Model
      2. 11.3.2. Objects, Methods, and Properties
        1. 11.3.2.1. Properties of the Document Object
        2. 11.3.2.2. Methods of the Document Object
      3. 11.3.3. The Forms Collection
        1. 11.3.3.1. Properties of the Form Objects
        2. 11.3.3.2. Methods of the Form Objects
      4. 11.3.4. Form Elements
        1. 11.3.4.1. Properties of Form Elements
        2. 11.3.4.2. Methods of Form Elements
      5. 11.3.5. Images Collection
        1. 11.3.5.1. Properties of the Image Object
      6. 11.3.6. Different Types of Objects
    4. 11.4. Starting to Program with JavaScript
    5. 11.5. Variables
      1. 11.5.1. Assigning a Value to a Variable
      2. 11.5.2. Lifetime of a Variable
    6. 11.6. Operators
      1. 11.6.1. Arithmetic Operators
      2. 11.6.2. Assignment Operators
      3. 11.6.3. Comparison Operators
      4. 11.6.4. Logical or Boolean Operators
      5. 11.6.5. String Operator
    7. 11.7. Functions
      1. 11.7.1. How to Define a Function
      2. 11.7.2. How to Call a Function
      3. 11.7.3. The Return Statement
    8. 11.8. Conditional Statements
      1. 11.8.1. if Statements
      2. 11.8.2. if . . . else Statements
      3. 11.8.3. A switch Statement
      4. 11.8.4. Conditional (or Ternary) Operator
    9. 11.9. Looping
      1. 11.9.1. while
      2. 11.9.2. do . . . while
      3. 11.9.3. for
      4. 11.9.4. Infinite Loops and the break Statement
    10. 11.10. Events
    11. 11.11. Built-in Objects
      1. 11.11.1. String
        1. 11.11.1.1. Properties
        2. 11.11.1.2. Methods
      2. 11.11.2. Date
      3. 11.11.3. Math
        1. 11.11.3.1. Properties
        2. 11.11.3.2. Methods
      4. 11.11.4. Array
        1. 11.11.4.1. Methods
      5. 11.11.5. Window
        1. 11.11.5.1. Properties
        2. 11.11.5.2. Methods
    12. 11.12. Writing JavaScript
      1. 11.12.1. A Word About Data Types
      2. 11.12.2. Keywords
    13. 11.13. Summary
    14. 11.14. Exercises
  17. 12. Working with JavaScript
    1. 12.1. Practical Tips for Writing Scripts
      1. 12.1.1. Has Someone Already Written This Script?
      2. 12.1.2. Reusable Functions
      3. 12.1.3. Using External JavaScript Files
      4. 12.1.4. Place Scripts in a Scripts Folder
    2. 12.2. Form Validation
      1. 12.2.1. When to Validate
      2. 12.2.2. How to Validate
        1. 12.2.2.1. Checking Text Fields
        2. 12.2.2.2. Required Text Fields
        3. 12.2.2.3. Finding Characters Using replace()
        4. 12.2.2.4. Testing Characters Using Test and Regular Expressions
        5. 12.2.2.5. Select Box Options
        6. 12.2.2.6. Radio Buttons
        7. 12.2.2.7. Checkboxes
        8. 12.2.2.8. Preventing a Form Submission Until a Checkbox Has Been Selected
    3. 12.3. Form Enhancements
      1. 12.3.1. Focus on First Form Item
      2. 12.3.2. Auto-Tabbing Between Fields
      3. 12.3.3. Disabling a Text Input
      4. 12.3.4. Case Conversion
      5. 12.3.5. Trimming Spaces from Beginning and End of Fields
      6. 12.3.6. Selecting All the Content of a Text Area
      7. 12.3.7. Check and Uncheck All Checkboxes
    4. 12.4. Image Rollovers
    5. 12.5. Random Script Generator
    6. 12.6. Pop-Up Windows
    7. 12.7. JavaScript Libraries
      1. 12.7.1. Animated Effects using Scriptaculous
      2. 12.7.2. Drag-and-Drop Sortable Lists Using Scriptaculous
      3. 12.7.3. Sortable Tables with MochiKit
      4. 12.7.4. Creating Calendars with YUI
      5. 12.7.5. Auto-Completing Text Inputs with YUI
    8. 12.8. When Not to Use JavaScript
      1. 12.8.1. Drop-Down Navigation Menus
      2. 12.8.2. Hiding Your E-mail Address
      3. 12.8.3. Quick Jump Select Boxes
      4. 12.8.4. Anything the User Requires from Your Site
    9. 12.9. Summary
    10. 12.10. Exercises
  18. 13. Putting Your Site on the Web
    1. 13.1. Meta Tags
      1. 13.1.1. name and content Attributes
        1. 13.1.1.1. Using name with a Value of description
        2. 13.1.1.2. Using name with a Value of keywords
        3. 13.1.1.3. Using name with a Value of robots
      2. 13.1.2. http-equiv and content
        1. 13.1.2.1. Expiring Pages
        2. 13.1.2.2. Preventing a Browser from Caching a Page
        3. 13.1.2.3. Refreshing and Redirecting Pages
        4. 13.1.2.4. Specifying Ratings
        5. 13.1.2.5. Setting Cookies
        6. 13.1.2.6. Specifying the Author Name
        7. 13.1.2.7. Setting the Character Encoding
        8. 13.1.2.8. Setting a Default Style Sheet Language
        9. 13.1.2.9. Setting a Default Scripting Language
      3. 13.1.3. The scheme Attribute
    2. 13.2. Testing Your Site
      1. 13.2.1. The Importance of Directory Structure and Relative URLs
      2. 13.2.2. Validating HTML, XHTML, and CSS
      3. 13.2.3. Link Checking
      4. 13.2.4. Checking Different Screen Resolutions and Color Depths
      5. 13.2.5. Accessibility Checkers
      6. 13.2.6. Development Server or Live Server
      7. 13.2.7. Checking in Different Versions of Browsers
      8. 13.2.8. Pilot Testing
      9. 13.2.9. Proofreading
    3. 13.3. Taking the Leap to Live
      1. 13.3.1. Getting a Domain Name
      2. 13.3.2. Hosting
        1. 13.3.2.1. Key Considerations for Choosing a Host
        2. 13.3.2.2. Putting Your Site on a Server Using FTP
      3. 13.3.3. Search Engine Strategies
        1. 13.3.3.1. Beyond meta Tags
        2. 13.3.3.2. Designing Your Page to Maximize Rankings
        3. 13.3.3.3. robots.txt
      4. 13.3.4. Other Web Marketing Possibilities
      5. 13.3.5. Statistical Analysis
      6. 13.3.6. Version Control
    4. 13.4. What Next?
      1. 13.4.1. Blogs
      2. 13.4.2. Discussion Boards or Forums
      3. 13.4.3. Adding a Search Utility
    5. 13.5. Introducing Other Technologies
      1. 13.5.1. Server-Side Web Programming: ASP.NET, and PHP
      2. 13.5.2. Choosing a Server-Side Language
      3. 13.5.3. Content Management
      4. 13.5.4. Flash
      5. 13.5.5. Learning Graphics Packages
    6. 13.6. Summary
  19. A. Answers to Exercises
    1. A.1. Chapter 1
    2. A.2. Chapter 2
    3. A.3. Chapter 3
    4. A.4. Chapter 4
    5. A.5. Chapter 5
    6. A.6. Chapter 6
    7. A.7. Chapter 7
    8. A.8. Chapter 8
    9. A.9. Chapter 9
    10. A.10. Chapter 10
    11. A.11. Chapter 11
    12. A.12. Chapter 12
  20. B. XHTML Element Reference
    1. B.1. Core Attributes
    2. B.2. <a> (all)
    3. B.3. <abbr> (IE4+, N6+, FF1+)
    4. B.4. <acronym> (IE4+, N6+, FF1+)
    5. B.5. <address> (all)
    6. B.6. <applet> Deprecated (all)
    7. B.7. <param> (all)
    8. B.8. <area> (all)
    9. B.9. <b> (all)
    10. B.10. <base>
    11. B.11. <basefont> Deprecated (all)
    12. B.12. <bdo> (IE5+, N6+, FF1+)
    13. B.13. <bgsound> (IE only — IE3+)
    14. B.14. <big> (IE4+, N4+, FF1)
    15. B.15. <blink> (Netscape/Firefox only — N3+, FF1+)
    16. B.16. <blockquote> (all)
    17. B.17. <body> (all)
    18. B.18. <br /> (all)
    19. B.19. <button> (IE4+, N3+, FF1+)
    20. B.20. <caption> (all)
    21. B.21. <center> Deprecated (all)
    22. B.22. <cite> (all)
    23. B.23. <code> (all)
    24. B.24. <col> (IE3+, N4+, FF1+)
    25. B.25. <colgroup> (IE3+, N4+, FF1+)
    26. B.26. <comment> (IE4+ only)
    27. B.27. <dd> (all)
    28. B.28. <del> (IE4+, N6+, FF1+)
    29. B.29. <dfn> (all)
    30. B.30. <dir> Deprecated (all)
      1. B.30.1. <li> (all)
    31. B.31. <div> (all)
    32. B.32. <dl> (all)
    33. B.33. <dt> (all)
    34. B.34. <em> (all)
    35. B.35. <embed> (all)
    36. B.36. <fieldset> (IE4+, N6+, FF1+)
    37. B.37. <font> Deprecated (all)
    38. B.38. <form> (all)
    39. B.39. <frame> (all)
    40. B.40. <noframes> (all)
    41. B.41. <frameset> (all)
    42. B.42. <head> (all)
    43. B.43. <hn> (all)
    44. B.44. <hr /> (all)
    45. B.45. <html> (all)
    46. B.46. <i> (all)
    47. B.47. <iframe> (IE3+, N6+, FF1+)
    48. B.48. <img> (all)
    49. B.49. <input type="button"> (all)
    50. B.50. <input type="checkbox"> (all)
    51. B.51. <input type="file"> (all)
    52. B.52. <input type="hidden"> (all)
    53. B.53. <input type="image"> (all)
    54. B.54. <input type="password"> (all)
    55. B.55. <input type="radio"> (all)
    56. B.56. <input type="reset"> (all)
    57. B.57. <input type="submit"> (all)
    58. B.58. <input type="text"> (all)
    59. B.59. <ins> (IE4+, N6+, FF1+)
    60. B.60. <isindex> Deprecated (all)
    61. B.61. <kbd> (all)
    62. B.62. <keygen> (Netscape only, N3+)
    63. B.63. <label> (IE4+, N6+, FF1+)
    64. B.64. <layer> (Netscape only, N4+)
    65. B.65. <legend> (IE4+, N6+, FF1+)
    66. B.66. <li> (all)
    67. B.67. <link> (all)
    68. B.68. <listing> Deprecated (IE3+)
    69. B.69. <map> (all)
    70. B.70. <marquee> (IE only, IE3+)
    71. B.71. <menu> Deprecated (all)
      1. B.71.1. <li> (all)
    72. B.72. <meta> (all)
    73. B.73. <multicol> (N3, N4 only)
    74. B.74. <nextid> (not supported in browsers)
    75. B.75. <nobr> (all)
    76. B.76. <noembed> (N2, N3, N4)
    77. B.77. <noframes> (all)
    78. B.78. <nolayer> (N4+ only)
    79. B.79. <noscript> (all)
    80. B.80. <object> (IE3+, N6+, FF1+)
      1. B.80.1. <param> (IE3+, N6+, FF1+)
    81. B.81. <ol> (all)
      1. B.81.1. <li> (all)
    82. B.82. <optgroup> (IE6+, N6+, FF1+)
    83. B.83. <option> (all)
    84. B.84. <p> (all)
    85. B.85. <param>
    86. B.86. <plaintext> Deprecated (IE3+, N2, N3, N4)
    87. B.87. <pre> (all)
    88. B.88. <q> (IE4+, N6+, FF1+)
    89. B.89. <s> Deprecated (all)
    90. B.90. <samp> (all)
    91. B.91. <script> (all)
    92. B.92. <select> (all)
    93. B.93. <small> (all)
    94. B.94. <span> (all)
    95. B.95. <strike> Deprecated (all)
    96. B.96. <strong> (all)
    97. B.97. <style> (IE3+, N4+, FF1+)
    98. B.98. <sub> (all)
    99. B.99. <sup> (all)
    100. B.100. <table> (all)
    101. B.101. <tbody> (IE3+, N6+, FF1+)
    102. B.102. <td> (all)
    103. B.103. <textarea> (all)
    104. B.104. <tfoot> (IE3+, N6+, FF1+)
    105. B.105. <thead> (IE3+, N6+, FF1+)
    106. B.106. <th> (all)
    107. B.107. <title> (all)
    108. B.108. <tr> (all)
    109. B.109. <tt> (all)
    110. B.110. <u> (all)
    111. B.111. <ul> (all)
      1. B.111.1. <li> (all)
    112. B.112. <var> (IE3+, N6+, FF1+)
    113. B.113. <wbr> (IE3, N2, N3, N4)
    114. B.114. <xmp> Deprecated (all)
  21. C. CSS Properties
    1. C.1. Font Properties
      1. C.1.1. font
      2. C.1.2. font-family
      3. C.1.3. font-size
      4. C.1.4. font-size-adjust
      5. C.1.5. font-stretch
      6. C.1.6. font-style
      7. C.1.7. font-variant
      8. C.1.8. font-weight
    2. C.2. Text Properties
      1. C.2.1. letter-spacing
      2. C.2.2. text-align
      3. C.2.3. text-decoration
      4. C.2.4. text-indent
      5. C.2.5. text-shadow
      6. C.2.6. text-transform
      7. C.2.7. white-space
      8. C.2.8. word-spacing
    3. C.3. Color and Background Properties
      1. C.3.1. background
      2. C.3.2. background-attachment
      3. C.3.3. background-color
      4. C.3.4. background-image
      5. C.3.5. background-position
      6. C.3.6. background-positionX
      7. C.3.7. background-positionY
    4. C.4. Border properties
      1. C.4.1. border (border-bottom, border-left, border-top, border-right)
      2. C.4.2. border-style (border-bottom-style, border-left-style, border-top-style, border-right-style)
      3. C.4.3. border-width (border-bottom-width, border-left-width, border-top-width, border-right-width)
      4. C.4.4. border-color (border-bottom-color, border-left-color, border-top-color, border-right-color)
    5. C.5. Dimensions
      1. C.5.1. height
      2. C.5.2. width
      3. C.5.3. line-height
      4. C.5.4. max-height
      5. C.5.5. max-width
      6. C.5.6. min-height
      7. C.5.7. min-width
    6. C.6. Margin Properties
      1. C.6.1. margin (margin-bottom, margin-left, margin-top, margin-right)
    7. C.7. Padding Properties
      1. C.7.1. padding (padding-bottom, padding-left, padding-right, padding-top)
    8. C.8. List Properties
      1. C.8.1. list-style
      2. C.8.2. list-style-position
      3. C.8.3. list-style-type
      4. C.8.4. marker-offset
    9. C.9. Positioning Properties
      1. C.9.1. position
      2. C.9.2. Top
      3. C.9.3. Left
      4. C.9.4. bottom
      5. C.9.5. right
      6. C.9.6. vertical-align
      7. C.9.7. z-index
      8. C.9.8. clip
      9. C.9.9. overflow
      10. C.9.10. overflow-x
      11. C.9.11. overflow-y
    10. C.10. Outline Properties
      1. C.10.1. Outline (outline-color, outline-style, outline-width)
    11. C.11. Table Properties
      1. C.11.1. border-collapse
      2. C.11.2. border-spacing
      3. C.11.3. caption-side
      4. C.11.4. empty-cells
      5. C.11.5. table-layout
    12. C.12. Classification Properties
      1. C.12.1. clear
      2. C.12.2. display
      3. C.12.3. float
      4. C.12.4. visibility
    13. C.13. Internationalization Properties
      1. C.13.1. direction
      2. C.13.2. unicode-bidi
    14. C.14. Lengths
      1. C.14.1. Absolute Lengths
      2. C.14.2. Relative Lengths
  22. D. Color Names and Values
    1. D.1. Using Hex Codes to Specify Colors
    2. D.2. Understanding Hex Codes
    3. D.3. Using Color Names to Specify Colors
    4. D.4. Hex Codes versus Color Names
    5. D.5. Color Name and Number Reference
  23. E. Character Encodings
  24. F. Special Characters
  25. G. Language Codes
  26. H. MIME Media Types
    1. H.1. text
    2. H.2. image
    3. H.3. multipart
    4. H.4. audio
    5. H.5. video
    6. H.6. message
    7. H.7. model
    8. H.8. application
  27. I. Deprecated and Browser-Specific Markup
    1. I.1. Why Deprecated Markup Exists
    2. I.2. Older Pages Break Many Rules
    3. I.3. Fonts
      1. I.3.1. The <font> Element
      2. I.3.2. The text Attribute
      3. I.3.3. The <basefont> Element
      4. I.3.4. The <s> and <strike> Elements
      5. I.3.5. The <u> Element
      6. I.3.6. The <listing>, <plaintext>, and <xmp> Elements
    4. I.4. Backgrounds
      1. I.4.1. The bgcolor Attribute
      2. I.4.2. The background Attribute
    5. I.5. Formatting
      1. I.5.1. The <center> Element
      2. I.5.2. The align Attribute
      3. I.5.3. The width Attribute
      4. I.5.4. The height Attribute
      5. I.5.5. The vspace Attribute
      6. I.5.6. The hspace Attribute
      7. I.5.7. The clear Attribute (on <br /> element)
    6. I.6. Links
    7. I.7. Lists
      1. I.7.1. The start Attribute
      2. I.7.2. The value Attribute
      3. I.7.3. The type Attribute
      4. I.7.4. The <dir> and <menu> Elements
    8. I.8. Tables
      1. I.8.1. The nowrap Attribute
    9. I.9. Miscellaneous Attributes
      1. I.9.1. The border Attribute
      2. I.9.2. The compact Attribute
      3. I.9.3. The language Attribute
      4. I.9.4. The version Attribute
      5. I.9.5. The <applet> Element
      6. I.9.6. The <embed> Element
      7. I.9.7. The <isindex> Element
      8. I.9.8. The <nobr> Element
    10. I.10. IE-Specific Elements
      1. I.10.1. IE-Specific Attributes
      2. I.10.2. IE-Specific CSS Styles
    11. I.11. Netscape-Specific Elements and Attributes
      1. I.11.1. Netscape-Specific Attributes