Table Of ContentHTML5
Seventh Edition
AND CSS
COMPREHENSIVE
Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
HTML5
Seventh Edition
AND CSS
COMPREHENSIVE
Denise M. Woods
William J. Dorin
Australia • Brazil • Japan • Korea • Mexico • Singapore • Spain • United Kingdom • United States
Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
This is an electronic version of the print textbook. Due to electronic rights restrictions, some third party content may be suppressed. Editorial
review has deemed that any suppressed content does not materially affect the overall learning experience. The publisher reserves the right to
remove content from this title at any time if subsequent rights restrictions require it. For valuable information on pricing, previous
editions, changes to current editions, and alternate formats, please visit www.cengage.com/highered to search by
ISBN#, author, title, or keyword for materials in your areas of interest.
Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
HTML5 and CSS © 2013 Course Technology, Cengage Learning
Comprehensive, Seventh Edition
ALL RIGHTS RESERVED. No part of this work covered by the copyright herein
Denise M. Woods, William J. Dorin
may be reproduced, transmitted, stored or used in any form or by any means
graphic, electronic, or mechanical, including but not limited to photocopying,
Vice President, Publisher: Nicole Pinard
recording, scanning, digitizing, taping, Web distribution, information networks,
Executive Editor: Kathleen McMahon
or information storage and retrieval systems, except as permitted under
Product Manager: Nada Jovanovic Section 107 or 108 of the 1976 United States Copyright Act, without the prior
Associate Product Manager: Caitlin Womersley written permission of the publisher.
Editorial Assistant: Angela Giannopoulos
For product information and technology assistance, contact us at
Director of Marketing: Elisa Roberts
Cengage Learning Customer & Sales Support, 1-800-354-9706
Associate Marketing Manager: Adrienne Fung
For permission to use material from this text or product,
Print Buyer: Julio Esperas submit all requests online at cengage.com/permissions
Director of Production: Patty Stephan Further permissions questions can be emailed to
[email protected]
Content Project Manager: Jennifer Feltri-
George
Library of Congress Control Number: 2012935297
Development Editor: Karen Stevens
ISBN-13: 978-1-1335-2614-8
Proofreader: Andrea Schein
Indexer: Michael Brackney ISBN-10: 1-1335-2614-4
QA Manuscript Reviewers: Jeff Schwartz and
Danielle Shaw Course Technology
Art Director: Marissa Falco 20 Channel Center Street
Boston, MA 02210
Cover Designer: Lisa Kuhn, Curio Press, LLC
USA
Cover Photo: Tom Kates Photography
Compositor: PreMediaGlobal
Cengage Learning is a leading provider of customized learning solutions with
office locations around the globe, including Singapore, the United Kingdom,
Australia, Mexico, Brazil, and Japan. Locate your local office at:
international.cengage.com/region
Cengage Learning products are represented in Canada by Nelson Education, Ltd.
For your course and learning solutions, visit www.cengage.com
To learn more about Course Technology, visit www.cengage.com/
coursetechnology
Purchase any of our products at your local collage bookstore or at our preferred
online store at www.CengageBrain.com
All screen shots are courtesy of Notepad++ and Microsoft Corporation unless
otherwise noted.
All rendered figures, including composed art and tables, are © Cengage
Learning unless otherwise noted.
Printed in the United States of America
1 2 3 4 5 6 16 15 14 13 11 12
Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
HTML5
Seventh Edition
AND CSS
COMPREHENSIVE
CCoonntteennttss
Preface xiv CHAPTER TWO
Creating and Editing a Web Page
HTML5 and CSS Using Inline Styles
Objectives HTML 33
CHAPTER ONE Introduction HTML 34
Introduction to HTML, XHTML, Project — Rock Climbing Fun Web Page HTML 34
and CSS Overview HTML 34
Objectives HTML 1 Elements of a Web Page HTML 37
Introduction HTML 2 Browser Window Elements HTML 37
What Is the Internet? HTML 2 Text Elements HTML 38
What Is the World Wide Web? HTML 3 Image Elements HTML 38
Web Servers HTML 4 Hyperlink Elements HTML 38
Web Site Types and Purposes HTML 5 Defining Web Page Structure HTML 39
Web Browsers HTML 7 Defining the HTML Document HTML 39
What Is Hypertext Markup Language? HTML 8 To Start Notepad++ HTML 40
HTML Elements HTML 9 To Enable Word Wrap in Notepad++ HTML 42
Useful HTML Practices HTML 10 To Define the Web Page Structure
HTML Versions HTML 11 Using HTML Tags HTML 42
Cascading Style Sheets HTML 11 Formatting the Web Page HTML 45
Document Object Model (DOM) HTML 12 Entering Web Page Content HTML 46
Extensible Hypertext Markup To Enter a Paragraph of Text HTML 48
Language (XHTML) HTML 12 To Enter a Heading HTML 49
Tools for Creating HTML Documents HTML 13 Using Lists to Present Content HTML 49
Web Development Life Cycle HTML 15 To Create an Unordered List HTML 51
Web Site Planning HTML 16 More About List Formats HTML 51
Web Site Analysis HTML 16 Adding a Footer HTML 53
Web Site Design and Development HTML 17 To Add a Footer HTML 53
Web Site Testing HTML 22 Saving and Organizing HTML Files HTML 54
Web Site Implementation and Maintenance HTML 24 To Save an HTML File HTML 55
Be an Observant Web User HTML 25 Using a Browser to View a Web Page HTML 58
Chapter Summary HTML 25 To Start a Browser HTML 58
Learn It Online HTML 26 To View a Web Page in a Browser HTML 59
Apply Your Knowledge HTML 26 To Activate Notepad++ HTML 60
Extend Your Knowledge HTML 27 Improving the Appearance of Your
Make It Right HTML 28 Web Page HTML 60
In the Lab HTML 29 Using Style Sheets HTML 61
Cases and Places HTML 32 Using Web Page Divisions HTML 63
v
Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
vi Contents HTML5 and CSS Comprehensive
Types of Web Page Images HTML 64 Adding Interest and Focus with HTML Tags HTML 110
Image Attributes HTML 65 Style Sheet Precedence Review HTML 112
Other Visual Enhancements HTML 67 Using Embedded Style Sheets HTML 112
To Add Color to a Web Page To Add Embedded Style Sheet Statements HTML 115
Heading HTML 69 To Add an Inline Style for Color HTML 117
To Change the Bulleted List Style HTML 70 To Save an HTML File HTML 117
To Add a Horizontal Rule HTML 70 Validating the HTML, Viewing the
To Change the Footer Style HTML 71 Web Page, and Testing Links HTML 117
To Refresh the View in a Browser HTML 72 To Validate HTML Code HTML 118
Validating and Viewing HTML Code HTML 72 To Print an HTML File HTML 119
To Validate HTML Code HTML 73 To Test Links on a Web Page HTML 121
To View HTML Source Code for a To Print a Web Page HTML 123
Web Page HTML 76 Editing the Second Web Page HTML 123
To Print a Web Page and an HTML File HTML 77 To Open an HTML File HTML 125
Chapter Summary HTML 79 Working with Classes in Style Statements HTML 126
Learn It Online HTML 79 Adding an Image with Wrapped Text HTML 128
Apply Your Knowledge HTML 80 Using Thumbnail Images HTML 130
Extend Your Knowledge HTML 81 To Wrap Text Around Images Using
Make It Right HTML 82 CSS Classes HTML 132
In the Lab HTML 83 To Clear Text Wrapping HTML 134
Cases and Places HTML 86 Adding Links Within a Web Page HTML 135
To Set Link Targets HTML 136
CHAPTER THREE To Add Links to Link Targets Within a
Creating Web Pages with Links, Images, Web Page HTML 137
and Embedded Style Sheets To Add Links to a Target at the Top of
the Page HTML 138
Objectives HTML 87
To Copy and Paste HTML Code HTML 138
Introduction HTML 88
To Add an Image Link to a Web Page HTML 139
Project — Underwater Tours by Eloise
To View and Test a Web Page HTML 141
Web Site HTML 88
Chapter Summary HTML 142
Overview HTML 89
Learn It Online HTML 142
Using Links on a Web Page HTML 91
Apply Your Knowledge HTML 143
Linking to Another Web Page Within the
Extend Your Knowledge HTML 144
Same Web Site HTML 93
Make It Right HTML 146
Linking to a Web Page in Another Web Site HTML 94
In the Lab HTML 147
Linking Within a Web Page HTML 96
Cases and Places HTML 152
Linking to an E-mail Address HTML 96
Creating a Home Page HTML 97
CHAPTER FOUR
To Start Notepad++ HTML 98
To Add a Banner Image HTML 100 Creating Tables in a Web Site
To Add Paragraphs of Text HTML 102 Using an External Style Sheet
Adding a Text Link to Another Web Page Objectives HTML 155
Within the Same Web Site HTML 103 Introduction HTML 156
To Add a Text Link to Another Web Page Project — Oceanside Hotel and Sports
Within the Same Web Site HTML 104 Club Web Site HTML 156
Adding an E-mail Link HTML 105 Overview HTML 158
To Add an E-mail Link HTML 105 Planning and Designing a Multipage
Adding Other Information to an E-mail Link HTML 106 Web Site HTML 159
To Add a Text Link to a Web Page in Creating Web Pages with Tables HTML 159
Another Web Site HTML 107 Table Elements HTML 161
Using Absolute and Relative Paths HTML 107 Adding Style to Table Elements HTML 162
Adding Interest and Focus with Styles HTML 110 Table Borders, Headers, Captions, and Rules HTML 163
Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
HTML5 and CSS Comprehensive Contents vii
Determining the Need for, Planning, To Add Keywords HTML 224
and Coding a Table HTML 164 To Add a Description HTML 225
Determining If a Table Is Needed HTML 164 Determining a Domain Name HTML 226
Planning the Table HTML 165 Check Domain Name Availability HTML 226
Coding the Table HTML 166 Finding a Web Hosting Site HTML 227
Table Tag Attributes HTML 167 Publishing Your Web Site HTML 227
Creating a Home Page with Banner Logo Marketing Your Web Site HTML 228
and Borderless Navigation Table HTML 169 Registering with Search Engines HTML 228
To Insert, Center, and Style an Image To Register Your Web Site with
with a Box-Shadow HTML 172 Search Engines HTML 229
Using a Table to Create a Horizontal Feature Summary HTML 230
Navigation Bar HTML 174 In the Lab HTML 230
To Create a Horizontal Menu Bar with
Image Links HTML 175 CHAPTER FIVE
Viewing the Web Page and Testing Links HTML 178 Creating an Image Map
External Style Sheets HTML 179
Objectives HTML 233
Adding an External Style Sheet HTML 181
Introduction HTML 234
To Create an External Style Sheet HTML 182
Project — Lake Tahanna Tourism HTML 234
Examining the External Style Sheet HTML 184
Overview HTML 236
Linking to the External Style Sheet HTML 187
Introduction to Image Maps HTML 237
To Link to an External Style Sheet HTML 187
Using Image Maps HTML 237
Validating and Printing the HTML,
Server-Side vs. Client-Side Image Maps HTML 242
Viewing the Web Page,
Creating an Image Map HTML 243
and Testing Links HTML 188
Selecting Images HTML 243
Creating a Second Web Page HTML 190
Sketching the Borders of Hotspots HTML 244
Adding a Table with Borders HTML 193
Mapping Image Coordinates HTML 246
To Create a Table with Borders and
Coding the Map HTML 248
Insert Text HTML 194
Using Paint to Locate X- and Y-Coordinates HTML 249
Adding a Link, Border Spacing,
To Start Paint HTML 249
Padding, and Row Color HTML 198
The Paint Window HTML 250
To Add Border Spacing, Padding, and
To Open an Image File in Paint HTML 251
Row Color to a Table HTML 200
Locating X- and Y-Coordinates of an Image HTML 251
Adding a Caption and Spanning Rows HTML 201
To Locate X- and Y-Coordinates of an Image HTML 252
To Add a Table Caption HTML 204
Other Software Tools HTML 254
To Create the Headings That Span Rows HTML 204
Creating the Home Page HTML 255
To Add the Bolder Class to Data Cells HTML 206
Inserting an Image to Use as an Image Map HTML 257
Chapter Summary HTML 208
To Insert an Image to Use as an Image Map HTML 258
Learn It Online HTML 208
Inserting Special Characters HTML 260
Apply Your Knowledge HTML 209
To Insert a Special Character HTML 261
Extend Your Knowledge HTML 210
Coding the Image Map Using HTML Tags
Make It Right HTML 211
and Attributes HTML 263
In the Lab HTML 212
To Create an Image Map HTML 264
Cases and Places HTML 217
Viewing the Web Page and Testing Links HTML 265
Creating an External Style Sheet HTML 268
SPECIAL FEATURE 1
To Create an External Style Sheet HTML 268
Attracting Visitors to Chapter Summary HTML 271
Your Web Site Learn It Online HTML 272
Objectives HTML 219 Apply Your Knowledge HTML 272
Introduction HTML 220 Extend Your Knowledge HTML 274
Project — Attracting Visitors HTML 220 Make It Right HTML 275
Overview HTML 220 In the Lab HTML 276
Adding Keywords HTML 222 Cases and Places HTML 280
To Open the File HTML 223
Meta Names HTML 223
Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
viii Contents HTML5 and CSS Comprehensive
CHAPTER SIX Adding a Navigation Bar with an
Creating a Form on a Web Page Embedded Style Sheet HTML 332
Setting the Body Style and Link Style,
Objectives HTML 283
and Adding a Drop-down Menu HTML 333
Introduction HTML 284
To Add an Embedded Style Sheet HTML 340
Project — Creating Forms on a Web Page HTML 284
Adding Pop-up Images with an
Overview HTML 286
External Style Sheet HTML 342
Web Page Forms HTML 287
Structuring the Web Page HTML 343
Input Controls HTML 287
Creating a Pop-up Image Using
HTML Tags Used to Create Forms HTML 291
Cascading Style Sheets HTML 343
Attributes of HTML Tags Used to
To Create an External Style Sheet HTML 345
Create Forms HTML 291
Linking to an External Style Sheet HTML 346
Creating a Form on a Web Page HTML 292
To Link to an External Style Sheet HTML 346
Creating a Form and Identifying
Creating an External Style Sheet
the Form Process HTML 293
for Printing HTML 348
To Create a Form and Identify
Understanding the Page Box Model HTML 348
the Form Process HTML 294
To Create an External Style Sheet
To Change the Text Message HTML 295
for Printing HTML 348
Adding Text Boxes HTML 296
Chapter Summary HTML 351
To Add Text Boxes HTML 296
Learn It Online HTML 351
Adding Check Boxes HTML 297
Apply Your Knowledge HTML 352
To Add Check Boxes HTML 298
Extend Your Knowledge HTML 353
Adding Radio Buttons HTML 298
Make It Right HTML 354
To Add Radio Buttons HTML 299
In the Lab HTML 355
Adding a Selection Menu HTML 299
Cases and Places HTML 358
To Add a Selection Menu HTML 300
Adding a Textarea Box HTML 303
To Add a Textarea Box HTML 303 CHAPTER EIGHT
Adding Submit and Reset Buttons HTML 304 Adding Multimedia Content to Web Pages
To Add Submit and Reset Buttons HTML 305 Objectives HTML 361
Organizing a Form Using Form Groupings HTML 306 Introduction HTML 362
To Add Fieldset Controls to Create Project — Adding Multimedia to an
Form Groupings HTML 307 English Literature Class Web Site HTML 362
Adding an Embedded Style Sheet HTML 308 Overview HTML 362
Chapter Summary HTML 314 Using Multimedia HTML 364
Learn It Online HTML 314 Creating or Finding Multimedia Files HTML 366
Apply Your Knowledge HTML 315 Embedded vs. External Multimedia HTML 366
Extend Your Knowledge HTML 316 Media Players and Plug-Ins HTML 367
Make It Right HTML 317 HTML5 and Multimedia HTML 368
In the Lab HTML 318 Audio and Video File Formats HTML 368
Cases and Places HTML 321 Adding an Audio File to a Web Page HTML 369
New HTML5 Multimedia Tags HTML 370
The Object Tag HTML 370
CHAPTER SEVEN
Object Tag Parameters HTML 372
Using Advanced Cascading Style Sheets
The HMTL5 <audio> Tag HTML 373
Objectives HTML 323
To Add an Audio Clip to a Web Page HTML 376
Introduction HTML 324
To Validate and View a Web Page
Project — Using Advanced Cascading
Using ActiveX Controls HTML 377
Style Sheets HTML 324
Adding a Video Clip to a Web Page HTML 380
Overview HTML 326
The HTML5 <video> Tag HTML 381
Using Style Sheets HTML 327
Using the <video> Tag HTML 381
Style Sheet Precedence Review HTML 330
To Add a Video Clip to a Web Page HTML 383
Adding Style Sheets to the Jared Adam’s
Adventure Travel Site HTML 330
Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
HTML5 and CSS Comprehensive Contents ix
Chapter Summary HTML 385 To Display Text and Variable Values to a
Learn It Online HTML 386 Web Page Using innerHTML HTML 427
Apply Your Knowledge HTML 386 Changing the Color of the Browser
Extend Your Knowledge HTML 387 Scroll Bar HTML 428
Make It Right HTML 388 To Enter the User-Defined Function to
In the Lab HTML 389 Change the Browser Scroll Bar Color HTML 428
Cases and Places HTML 392 Using the selectedIndex Property and the
Location Object to Link to a New URL HTML 429
SPECIAL FEATURE 2 To Enter the User-Defined Function to Link
Converting Frames on Your Web Site to a New URL Using the
Drop-Down Menu HTML 431
Objectives HTML 393
Displaying the Date the Document Was
Introduction HTML 394
Last Modified HTML 432
Project — Converting Frames HTML 394
To Include the Date Last Modified and a
Overview HTML 394
Copyright Message in a Text String HTML 433
The Frame Definition File HTML 396
Completing the JavaScript Section HTML 433
To View a Web Site with Frames HTML 398
To Enter the End Comment and
Frame Layouts HTML 399
End </script> Tags HTML 434
Determining a Conversion Strategy HTML 401
Calling JavaScript Functions Using
To Copy HTML Code for a Navigation Bar HTML 402
Event Handlers HTML 435
To Paste Code into the Home Page and Edit
To Associate User-Defined Functions
the Code HTML 403
with the OnLoad Event HTML 435
To Copy and Paste Code into the Schedule
To Associate a User-Defined Function
and Contact Web Pages HTML 404
with the OnChange Event HTML 436
Feature Summary HTML 405
Chapter Summary HTML 439
In the Lab HTML 406
Learn It Online HTML 440
Apply Your Knowledge HTML 440
CHAPTER NINE
Extend Your Knowledge HTML 442
Integrating JavaScript and HTML5 Make It Right HTML 444
Objectives HTML 409 In the Lab HTML 446
Introduction HTML 410 Cases and Places HTML 451
Project — Midwest Bridal Expo
Web Page HTML 410
CHAPTER TEN
Overview HTML 410
Creating Pop-Up Windows,
JavaScript HTML 412
Adding Scrolling Messages, and
User-Defined Functions HTML 414
To Enter a <div> Tag Container HTML 416 Validating Forms
Writing User-Defined Functions HTML 416 Objectives HTML 453
Inserting <script> Tags in the Introduction HTML 454
<head> Section HTML 417 Project — Shoreline State Bank
To Enter the Start <script> and Loan Calculator HTML 454
Comment Tags HTML 418 Overview HTML 456
Using JavaScript Variables HTML 418 Inserting a Scrolling Message
Extracting the Current System Date HTML 420 on a Web Page HTML 457
To Extract the Current System Date Using To Create a Form Text Field to Display a
the Date() Object HTML 423 Scrolling Message HTML 458
Calculating the Number of Days Until a Creating the scrollingMsg()
Future Event HTML 424 User-Defined Function HTML 459
To Calculate the Number of Days to a To Create the scrollingMsg()
Future Date HTML 425 User-Defined Function HTML 460
Displaying Text and Variable Values to a To Enter the Code to Increment the
Web Page with innerHTML HTML 426 Position Locator Variable HTML 461
Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.