You are previewing HTML, CSS and JavaScript All in One, Sams Teach Yourself: Covering HTML5, CSS3, and jQuery, Second Edition.
O'Reilly logo
HTML, CSS and JavaScript All in One, Sams Teach Yourself: Covering HTML5, CSS3, and jQuery, Second Edition

Book Description

In just a short time, you can learn how to use HTML5, Cascading Style Sheets (CSS3), and JavaScript together to design, create, and maintain world-class websites.


Using a straightforward, step-by-step approach, each lesson in this book builds on the previous ones, enabling you to learn the essentials from the ground up.


Clear instructions and practical, hands-on examples show you how to use HTML to create the framework of your website, design your site's layout and typography with CSS, and then add interactivity with JavaScript and jQuery.

  • Step-by-step instructions carefully walk you through the most common web development tasks

  • Practical, hands-on examples show you how to apply what you learn

  • Quizzes and exercises help you test your knowledge and stretch your skills

  • Learn how to...

  • Build your own web page and get it online in an instant

  • Format text for maximum clarity and readability

  • Create links to other pages and to other sites

  • Add graphics, color, and visual pizzazz to your web pages

  • Work with transparent images and background graphics

  • Design your site’s layout and typography using CSS

  • Get user input with web-based forms

  • Use JavaScript to build dynamic, interactive web pages

  • Add AJAX effects to your web pages

  • Leverage JavaScript libraries such as jQuery

  • Make your site easy to maintain and update as it grows

  • Contents at a Glance


    Part I Getting Started on the Web

    1 Understanding How the Web Works

    2 Structuring an HTML Document

    3 Understanding Cascading Style Sheets

    4 Understanding JavaScript

    5 Validating and Debugging Your Code


    Part II Building Blocks of Practical Web Design

    6 Working with Fonts, Text Blocks, Lists, and Tables

    7 Using External and Internal Links

    8 Working with Colors, Images, and Multimedia


    Part III Advanced Web Page Design with CSS

    9 Working with Margins, Padding, Alignment, and Floating

    10 Understanding the CSS Box Model and Positioning

    11 Using CSS to Do More with Lists, Text, and Navigation

    12 Creating Fixed or Liquid Layouts


    Part IV Getting Started with Dynamic Sites

    13 Understanding Dynamic Websites and HTML5 Applications

    14 Getting Started with JavaScript Programming

    15 Working with the Document Object Model (DOM)

    16 Using JavaScript Variables, Strings, and Arrays

    17 Using JavaScript Functions and Objects

    18 Controlling Flow with Conditions and Loops

    19 Responding to Events

    20 Using Windows


    Part V Advanced JavaScript Programming

    21 JavaScript Best Practices

    22 Using Third-Party JavaScript Libraries and Frameworks

    23 A Closer Look at jQuery

    24 First Steps Toward Creating Rich Interactions with jQuery UI

    25 AJAX: Remote Scripting


    Part VI Advanced Website Functionality and Management

    26 Working with Web-Based Forms

    27 Organizing and Managing a Website

    Table of Contents

    1. About This eBook
    2. Title Page
    3. Copyright Page
    4. Contents at a Glance
    5. Table of Contents
    6. About the Author
    7. We Want to Hear from You!
    8. Reader Services
    9. Part I: Getting Started on the Web
      1. Chapter 1. Understanding How the Web Works
        1. A Brief History of HTML and the World Wide Web
        2. Creating Web Content
        3. Understanding Web Content Delivery
        4. Selecting a Web Hosting Provider
        5. Testing with Multiple Web Browsers
        6. Creating a Sample File
        7. Using FTP to Transfer Files
        8. Understanding Where to Place Files on the Web Server
        9. Distributing Content Without a Web Server
        10. Tips for Testing Web Content
        11. Summary
        12. Q&A
        13. Workshop
      2. Chapter 2. Structuring an HTML Document
        1. Getting Prepared
        2. Getting Started with a Simple Web Page
        3. HTML Tags Every Web Page Must Have
        4. Organizing a Page with Paragraphs and Line Breaks
        5. Organizing Your Content with Headings
        6. Understanding Semantic Elements
        7. Using <header> in Multiple Ways
        8. Understanding the <section> Element
        9. Using <article>
        10. Implementing the <nav> Element
        11. When to Use <aside>
        12. Using <footer> Effectively
        13. Summary
        14. Q&A
        15. Workshop
      3. Chapter 3. Understanding Cascading Style Sheets
        1. How CSS Works
        2. A Basic Style Sheet
        3. A CSS Style Primer
        4. Using Style Classes
        5. Using Style IDs
        6. Internal Style Sheets and Inline Styles
        7. Summary
        8. Q&A
        9. Workshop
      4. Chapter 4. Understanding JavaScript
        1. Learning Web Scripting Basics
        2. How JavaScript Fits into a Web Page
        3. Exploring JavaScript’s Capabilities
        4. Displaying Time with JavaScript
        5. Testing the Script
        6. Summary
        7. Q&A
        8. Workshop
      5. Chapter 5. Validating and Debugging Your Code
        1. Validating Your Web Content
        2. Debugging HTML and CSS Using Developer Tools
        3. Debugging JavaScript Using Developer Tools
        4. Summary
        5. Q&A
        6. Workshop
    10. Part II: Building Blocks of Practical Web Design
      1. Chapter 6. Working with Fonts, Text Blocks, Lists, and Tables
        1. Working with Special Characters
        2. Boldface, Italics, and Special Text Formatting
        3. Tweaking the Font
        4. Using Web Fonts
        5. Aligning Text on a Page
        6. The Three Types of HTML Lists
        7. Placing Lists Within Lists
        8. Creating a Simple Table
        9. Controlling Table Sizes
        10. Alignment and Spanning Within Tables
        11. Page Layout with Tables
        12. Using CSS Columns
        13. Summary
        14. Q&A
        15. Workshop
      2. Chapter 7. Using External and Internal Links
        1. Using Web Addresses
        2. Linking Within a Page Using Anchors
        3. Linking Between Your Own Web Content
        4. Linking to External Web Content
        5. Linking to an Email Address
        6. Opening a Link in a New Browser Window
        7. Using CSS to Style Hyperlinks
        8. Summary
        9. Q&A
        10. Workshop
      3. Chapter 8. Working with Colors, Images, and Multimedia
        1. Best Practices for Choosing Colors
        2. Understanding Web Colors
        3. Using Hexadecimal Values for Colors
        4. Using CSS to Set Background, Text, and Border Colors
        5. Choosing Graphics Software
        6. The Least You Need to Know About Graphics
        7. Preparing Photographic Images
        8. Creating Banners and Buttons
        9. Reducing or Removing Colors in an Image
        10. Creating Tiled Background Images
        11. Creating Animated Web Graphics
        12. Placing Images on a Web Page
        13. Describing Images with Text
        14. Specifying Image Height and Width
        15. Aligning Images
        16. Turning Images into Links
        17. Using Background Images
        18. Using Imagemaps
        19. Linking to Multimedia Files
        20. Embedding Multimedia Files
        21. Using Pure HTML5 for Audio and Video Playback
        22. Additional Tips for Using Multimedia
        23. Summary
        24. Q&A
        25. Workshop
    11. Part III: Advanced Web Page Design with CSS
      1. Chapter 9. Working with Margins, Padding, Alignment, and Floating
        1. Using Margins
        2. Padding Elements
        3. Keeping Everything Aligned
        4. Understanding the Float Property
        5. Summary
        6. Q&A
        7. Workshop
      2. Chapter 10. Understanding the CSS Box Model and Positioning
        1. The CSS Box Model
        2. The Whole Scoop on Positioning
        3. Controlling the Way Things Stack Up
        4. Managing the Flow of Text
        5. Summary
        6. Q&A
        7. Workshop
      3. Chapter 11. Using CSS to Do More with Lists, Text, and Navigation
        1. HTML List Refresher
        2. How the CSS Box Model Affects Lists
        3. Placing List Item Indicators
        4. Creating Imagemaps with List Items and CSS
        5. How Navigation Lists Differ from Regular Lists
        6. Creating Vertical Navigation with CSS
        7. Creating Horizontal Navigation with CSS
        8. Summary
        9. Q&A
        10. Workshop
      4. Chapter 12. Creating Fixed or Liquid Layouts
        1. Understanding Fixed Layouts
        2. Understanding Liquid Layouts
        3. Creating a Fixed/Liquid Hybrid Layout
        4. Considering a Responsive Web Design
        5. Summary
        6. Q&A
        7. Workshop
    12. Part IV: Getting Started with Dynamic Sites
      1. Chapter 13. Understanding Dynamic Websites and HTML5 Applications
        1. Understanding the Different Types of Scripting
        2. Including JavaScript in HTML
        3. Displaying Random Content
        4. Understanding the Document Object Model
        5. Changing Images Based on User Interaction
        6. Thinking Ahead to Developing HTML5 Applications
        7. Summary
        8. Q&A
        9. Workshop
      2. Chapter 14. Getting Started with JavaScript Programming
        1. Basic Concepts
        2. JavaScript Syntax Rules
        3. Using Comments
        4. Best Practices for JavaScript
        5. Understanding JSON
        6. Summary
        7. Q&A
        8. Workshop
      3. Chapter 15. Working with the Document Object Model (DOM)
        1. Understanding the Document Object Model
        2. Using window Objects
        3. Working with the document Object
        4. Accessing Browser History
        5. Working with the location Object
        6. More About the DOM Structure
        7. Working with DOM Nodes
        8. Creating Positionable Elements (Layers)
        9. Hiding and Showing Objects
        10. Modifying Text Within a Page
        11. Adding Text to a Page
        12. Summary
        13. Q&A
        14. Workshop
      4. Chapter 16. Using JavaScript Variables, Strings, and Arrays
        1. Using Variables
        2. Understanding Expressions and Operators
        3. Data Types in JavaScript
        4. Converting Between Data Types
        5. Using String Objects
        6. Working with Substrings
        7. Using Numeric Arrays
        8. Using String Arrays
        9. Sorting a Numeric Array
        10. Summary
        11. Q&A
        12. Workshop
      5. Chapter 17. Using JavaScript Functions and Objects
        1. Using Functions
        2. Introducing Objects
        3. Using Objects to Simplify Scripting
        4. Extending Built-in Objects
        5. Using the Math Object
        6. Working with Math Methods
        7. Working with Dates
        8. Summary
        9. Q&A
        10. Workshop
      6. Chapter 18. Controlling Flow with Conditions and Loops
        1. The if Statement
        2. Using Shorthand Conditional Expressions
        3. Testing Multiple Conditions with if and else
        4. Using Multiple Conditions with switch
        5. Using for Loops
        6. Using while Loops
        7. Using do...while Loops
        8. Working with Loops
        9. Looping Through Object Properties
        10. Summary
        11. Q&A
        12. Workshop
      7. Chapter 19. Responding to Events
        1. Understanding Event Handlers
        2. Using Mouse Events
        3. Using Keyboard Events
        4. Using the onload and onunload Events
        5. Using onclick to Change a <div>’s Appearance
        6. Summary
        7. Q&A
        8. Workshop
      8. Chapter 20. Using Windows
        1. Controlling Windows with Objects
        2. Moving and Resizing Windows
        3. Using Timeouts
        4. Displaying Dialog Boxes
        5. Summary
        6. Q&A
        7. Workshop
    13. Part V: Advanced JavaScript Programming
      1. Chapter 21. JavaScript Best Practices
        1. Scripting Best Practices
        2. Reading Browser Information
        3. Cross-Browser Scripting
        4. Supporting Non-JavaScript-Enabled Browsers
        5. Summary
        6. Q&A
        7. Workshop
      2. Chapter 22. Using Third-Party JavaScript Libraries and Frameworks
        1. Using Third-Party JavaScript Libraries
        2. Adding JavaScript Effects Using a Third-Party Library
        3. Using JavaScript Frameworks
        4. Summary
        5. Q&A
        6. Workshop
      3. Chapter 23. A Closer Look at jQuery
        1. Preparing to Use jQuery
        2. Becoming Familiar with the $(document).ready Handler
        3. Selecting DOM and CSS Content
        4. Manipulating HTML Content
        5. Putting the Pieces Together to Create a jQuery Animation
        6. Handling Events with jQuery
        7. Summary
        8. Q&A
        9. Workshop
      4. Chapter 24. First Steps Toward Creating Rich Interactions with jQuery UI
        1. Preparing to Use jQuery UI
        2. Using Selectors in jQuery UI
        3. Positioning UI Elements with jQuery UI
        4. Applying jQuery UI Effects
        5. Using jQuery UI Widgets for Advanced Interactions
        6. Where to Go from Here
        7. Summary
        8. Q&A
        9. Workshop
      5. Chapter 25. AJAX: Remote Scripting
        1. Introducing AJAX
        2. Using XMLHttpRequest
        3. Creating a Simple AJAX Library
        4. Creating an AJAX Quiz Using the Library
        5. Debugging AJAX-Based Applications
        6. Using jQuery’s Built-in Functions for AJAX
        7. Summary
        8. Q&A
        9. Workshop
    14. Part VI: Advanced Website Functionality and Management
      1. Chapter 26. Working with Web-Based Forms
        1. How HTML Forms Work
        2. Creating a Form
        3. Accepting Text Input
        4. Naming Each Piece of Form Data
        5. Labeling Each Piece of Form Data
        6. Grouping Form Elements
        7. Exploring Form Input Controls
        8. Using HTML5 Form Validation
        9. Submitting Form Data
        10. Accessing Form Elements with JavaScript
        11. Summary
        12. Q&A
        13. Workshop
      2. Chapter 27. Organizing and Managing a Website
        1. When One Page Is Enough
        2. Organizing a Simple Site
        3. Organizing a Larger Site
        4. Writing Maintainable Code
        5. Thinking About Version Control
        6. Using HTML and CSS Frameworks
        7. Summary
        8. Q&A
        9. Workshop
    15. Index