Sams Teach Yourself HTML, CSS, & JavaScript All-in-One

cover of Sams Teach Yourself HTML, CSS, & JavaScript All-in-OneThe following information is for the 2nd edition, published in 2014.

This book features content from Sams Teach Yourself HTML & CSS in 24 Hours (9th ed.) plus a wee bit of content from Phil Ballard’s and Michael Moncour’s Sams Teach Yourself JavaScript in 24 Hours (5th ed.) and Brad Dayley’s Sams Teach Yourself jQuery and JavaScript in 24 Hours.

The goal of this book is to give you a taste of many the skills you need to create a modern, standards-compliant web site using HTML5 and CSS with some level of interactivity and dynamism using JavaScript and JavaScript libraries. A few additional chapters are devoted specifically to some first steps with jQuery and jQuery UI.

As with all of my books, this book is not intended as the be-all and end-all of your education in this matter: it’s a first step, which will hopefully illuminate the pathways of all the other steps you will need to take to become an expert in these areas. Check out the Table of Contents below to see if this could be a book for you!

Previous Editions:

  • 1st ed. ISBN 0672333325, © Sams 2011. Translations: Chinese (Simplified), Greek, Spanish. Get source code at GitHub.

Table of Contents

This table of contents reflects the sub-headings within each chapter. Each chapter also has a summary, quiz questions, and one or more activities for you to try on your own.

» PART I: GETTING STARTED ON THE WEB

Chapter 1: Understanding How the Web Works

  • A Brief History of HTML and the World Wide Web
  • Creating Web Content
  • Understanding Web Content Delivery
  • Selecting a Web Hosting Provider
  • Testing with Multiple Web Browsers
  • Creating a Sample File
  • Using FTP to Transfer Files
  • Distributing Content without a Web Server
  • Tips for Testing Web Content

Chapter 2: Structuring an HTML Document

  • Getting Started with a Simple Web Page
  • HTML Tags Every Page Must Have
  • Organizing a Page with Paragraphs and Line Breaks
  • Organizing Your Content with Headings
  • Understanding Semantic Elements
  • Using <header> in Multiple Ways
  • Understanding <section>
  • Using <article>
  • Implementing <nav>
  • When to Use <aside>
  • Effective Use of <footer>

Chapter 3: Understanding Cascading Style Sheets

  • How CSS Works
  • A Basic Style Sheet
  • A CSS Style Primer
  • Using Style Classes
  • Using Style IDs
  • Internal Style Sheets and Inline Styles

Chapter 4: Understanding JavaScript

  • Learning Web Scripting Basics
  • How JavaScript Fits into a Web Page
  • Exploring JavaScript’s Capabilities
  • Displaying Time with JavaScript
  • Beginning the Script
  • Adding JavaScript Statements
  • Creating Output
  • Adding the Script to the Web Page
  • Testing the Script

Chapter 5: Validating and Debugging Your Code

  • Validating Your Web Content
  • Debugging HTML & CSS Using Developer Tools
  • Using the JavaScript Console to Debug JavaScript

» PART II: BUILDING BLOCKS OF PRACTICAL WEB DESIGN

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

  • Boldface, Italics, and Special Text Formatting
  • Tweaking the Font
  • Working with Special Characters
  • Aligning Text on a Page
  • The Three Types of HTML Lists
  • Placing Lists Within Lists
  • Creating a Simple Table
  • Controlling Table Sizes
  • Alignment and Spanning Within Tables
  • Page Layout with Tables

Chapter 7: Using External and Internal Links

  • Using Web Addresses
  • Linking Within a Page Using Anchors
  • Linking Between Your Own Web Content
  • Linking to External Web Content
  • Linking to an Email Address
  • Opening a Link in a New Browser Window
  • Using CSS to Style Hyperlinks

Chapter 8: Working with Colors, Images, and Multimedia

  • Best Practices for Choosing Colors
  • Understanding Web Colors
  • Using Hexadecimal Values for Colors
  • Using CSS to Set Background, Text, and Border Colors
  • Choosing Graphics Software
  • The Least You Need to Know About Graphics
  • Preparing Photographic Images
  • Creating Banners and Buttons
  • Reducing the Number of Colors in an Image
  • Working with Transparent Images
  • Creating Tiled Backgrounds
  • Creating Animated Web Graphics
  • Placing Images on a Web Page
  • Describing Images with Text
  • Specifying Image Height and Width
  • Aligning Images
  • Turning Images into Links
  • Using Background Images
  • Using Imagemaps
  • Linking to Multimedia Files
  • Using HTML5 for Audio and Video Playback

» PART III: ADVANCED WEB PAGE DESIGN WITH CSS

Chapter 9: Working with Margins, Padding, Alignment, and Floating

  • Using Margins
  • Padding Elements
  • Keeping Everything Aligned
  • Understanding the Float Property

Chapter 10: Understanding the CSS Box Model and Positioning

  • The CSS Box Model
  • The Whole Scoop on Positioning
  • Controlling the Way Things Stack Up
  • Managing the Flow of Text

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

  • HTML List Refresher
  • How the CSS Box Model Affects Lists
  • Placing List Item Indicators
  • Creating Image Maps with List Items and CSS
  • How Navigation Lists Differ from Regular Lists
  • Creating Vertical Navigation with CSS
  • Creating Horizontal Navigation with CSS

Chapter 12: Creating Fixed or Liquid Layouts

  • Understanding Fixed Layouts
  • Understanding Liquid Layouts
  • Creating a Fixed/Liquid Hybrid Layout
  • Considering a Responsive Design

» PART IV: GETTING STARTED WITH DYNAMIC WEB SITES

Chapter 13: Understanding Dynamic Web Sites & HTML5 Applications

  • Understanding the Different Types of Scripting
  • Including JavaScript in HTML
  • Displaying Random Content
  • Understanding the Document Object Model
  • Changing Images Based on User Interaction
  • Thinking Ahead to Developing HTML5 Applications

Chapter 14: Getting Started with JavaScript Programming

  • Basic Concepts
  • JavaScript Syntax Rules
  • Using Comments
  • Best Practices for JavaScript
  • Understanding JSON

Chapter 15: Working with the Document Object Model (DOM)

  • Understanding the Document Object Model (DOM)
  • Using window Objects
  • Working with the document Object
  • Accessing Browser History
  • Working with the location Object
  • More About the DOM Structure
  • Working with DOM Nodes
  • Creating Positionable Elements (Layers)
  • Hiding and Showing Objects
  • Modifying Text Within a Page
  • Adding Text to a Page

Chapter 16: Using JavaScript Variables, Strings, and Arrays

  • Using Variables
  • Understanding Expressions and Operators
  • Data Types in JavaScript
  • Converting Between Data Types
  • Using String Objects
  • Working with Substrings
  • Using Numeric Arrays
  • Using String Arrays
  • Sorting a Numeric Array

Chapter 17: Using JavaScript Functions and Objects

  • Using Functions
  • Introducing Objects
  • Using Objects to Simplify Scripting
  • Extending Built-in Objects
  • Using the Math Object
  • Working with Math Functions
  • Working with Dates

Chapter 18: Controlling Flow with Conditions and Loops

  • The if Statement
  • Using Shorthand Conditional Expressions
  • Testing Multiple Conditions with switch
  • Using for Loops
  • Using while Loops
  • Using do…while Loops
  • Working with Loops
  • Looping Through Object Properties

Chapter 19: Responding to Events

  • Understanding Event Handlers
  • Using Mouse Events
  • Using Keyboard Events
  • Using the onLoad and onUnload Events
  • Using onClick to Change <div> Appearance

Chapter 20: Using Windows

  • Controlling Windows with Objects
  • Moving and Resizing Windows
  • Using Timeouts
  • Displaying Dialog Boxes

» PART V: ADVANCED JAVASCRIPT PROGRAMMING

Chapter 21: JavaScript Best Practices

  • Scripting Best Practices
  • Reading Browser Information
  • Cross-Browser Scripting
  • Supporting Non-JavaScript Browsers

Chapter 22: Using Third-Party JavaScript Libraries and Frameworks

  • Using Third-Party JavaScript Libraries
  • Adding JavaScript Effects Using a Third-Party Library
  • Using JavaScript Frameworks

Chapter 23: A Closer Look at jQuery

  • Preparing to Use jQuery
  • Becoming Familiar with the $(document).ready Handler
  • Selecting DOM and CSS Content
  • Manipulating HTML Content
  • Putting the Pieces Together to Create a jQuery Animation
  • Handling Events with jQuery

Chapter 24: First Steps Toward Creating Rich Interactions with jQuery UI

  • Preparing to Use jQuery UI
  • Using Selectors in jQuery UI
  • Positioning UI Elements with jQuery UI
  • Applying jQuery UI Effects
  • Using jQuery UI Widgets for Advanced Interactions
  • Where to Go From Here

Chapter 25: AJAX: Remote Scripting

  • Introducing AJAX
  • Using XMLHttpRequest
  • Creating a Simple AJAX Library
  • Creating an AJAX Quiz Using the Library
  • Debugging AJAX Applications
  • Using jQuery’s Built-in Functions for AJAX

» PART VI: ADVANCED WEBSITE FUNCTIONALITY AND MANAGEMENT

Chapter 26: Working with Web-Based Forms

  • How HTML Forms Work
  • Creating a Form
  • Accepting Text Input
  • Naming Each Piece of Form Data
  • Exploring Form Input Controls
  • Using HTML5 Form Validation
  • Submitting Form Data
  • Accessing Form Elements with JavaScript
  • Displaying Data from a Form

Chapter 27: Organizing and Managing a Web Site

  • When One Page Is Enough
  • Organizing a Simple Site
  • Organizing a Larger Site
  • Writing Maintainable HTML Code
  • Thinking About Version Control
  • Using HTML and CSS Frameworks