HTML CSS and JavaScript All in One Covering HTML5 CSS3 and ES6 Sams Teach Yourself 3rd Edition Meloni instant download
HTML CSS and JavaScript All in One Covering HTML5 CSS3 and ES6 Sams Teach Yourself 3rd Edition Meloni instant download
https://ebookmeta.com/product/html-css-and-javascript-all-in-one-
covering-html5-css3-and-es6-sams-teach-yourself-3rd-edition-
meloni/
https://ebookmeta.com/product/sams-teach-yourself-c-in-one-hour-
a-day-9th-edition-siddhartha-rao/
Teach Yourself VISUALLY HTML and CSS The Fast and Easy
Way to Learn 2nd Edition Guy Hart-Davis
https://ebookmeta.com/product/teach-yourself-visually-html-and-
css-the-fast-and-easy-way-to-learn-2nd-edition-guy-hart-davis/
https://ebookmeta.com/product/sams-teach-yourself-sap-
in-24-hours-fourth-edition-george-w-anderson/
https://ebookmeta.com/product/snowflakes-and-holidates-02-riley-
ash-my-hero-holidate-1st-edition-riley-ash/
Wardlaw's Contemporary Nutrition: A Functional Approach
6th Edition Anne M. Smith
https://ebookmeta.com/product/wardlaws-contemporary-nutrition-a-
functional-approach-6th-edition-anne-m-smith/
https://ebookmeta.com/product/black-mental-health-patients-
providers-and-systems-1st-edition-ezra-e-h-griffith/
https://ebookmeta.com/product/eye-yield-ophthalmology-basics-for-
board-and-frcs-part-1-exams-saif-aldeen-saleh-alryalat/
https://ebookmeta.com/product/art-subjects-making-artists-in-the-
american-university-howard-singerman/
https://ebookmeta.com/product/self-care-all-in-one-for-dummies-
shamash-alidina/
Fokker Aircraft of WWI Volume 5 1918 Design Part 1
Prototypes D VI 1st Edition Jack Herris
https://ebookmeta.com/product/fokker-aircraft-of-wwi-
volume-5-1918-design-part-1-prototypes-d-vi-1st-edition-jack-
herris/
Jennifer Kyrnin
Julie Meloni
SamsTeach Yourself
HTML, CSS,
and JavaScript
Third Edition
All
One
in
Sams Teach Yourself HTML, CSS, and JavaScript All in One, Third Edition Editor-in-Chief
Copyright © 2019 by Pearson Education, Inc. Mark Taub
All rights reserved. This publication is protected by copyright, and permission must be obtained
Editor
from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmis-
sion in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. Mark Taber
For information regarding permissions, request forms, and the appropriate contacts within the Managing Editor
Pearson Education Global Rights & Permissions Department, please visit www.pearsoned.com/
permissions/. No patent liability is assumed with respect to the use of the information contained Sandra Schroeder
herein. Although every precaution has been taken in the preparation of this book, the publisher Senior Project
and authors assume no responsibility for errors or omissions. Nor is any liability assumed for Editor
damages resulting from the use of the information contained herein.
Lori Lyons
ISBN-13: 978-0-672-33808-3
ISBN-10: 0-672-33808-4 Copy Editor
Library of Congress Control Number: 2018953965 Kitty Wilson
01 18 Project Manager
Trademarks Suganya Karuppasamy
All terms mentioned in this book that are known to be trademarks or service marks have Indexer
been appropriately capitalized. Pearson cannot attest to the accuracy of this information.
Use of a term in this book should not be regarded as affecting the validity of any trademark Ken Johnson
or service mark. Proofreader
Warning and Disclaimer Abigail Manheim
Every effort has been made to make this book as complete and as accurate as possible, but no
Technical Editor
warranty or fitness is implied. The information provided is on an “as is” basis. The author and the
publisher shall have neither liability nor responsibility to any person or entity with respect to any Julie Meloni
loss or damages arising from the information contained in this book or from the use of the CD or Editorial Assistant
programs accompanying it.
Cindy Teeters
Special Sales
For information about buying this title in bulk quantities, or for special sales opportunities (which Cover Designer
may include electronic versions; custom cover designs; and content particular to your business, Chuti Prasertsith
training goals, marketing focus, or branding interests), please contact our corporate sales
Compositor
department at [email protected] or (800) 382-3419.
codemantra
For government sales inquiries, please contact [email protected].
For questions about sales outside the U.S., please contact [email protected].
Contents at a Glance
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751
Table of Contents
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Q&A ................................................................................................... 118
Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
LESSON 6: Working with Fonts, Text Blocks, Lists, and Tables 121
Working with Special Characters ............................................................ 122
Boldface, Italic, and Special Text Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Tweaking the Font. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Using Web Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Aligning Text on a Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
The Three Types of HTML Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Placing Lists Within Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Creating a Simple Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Controlling Table Sizes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Alignment and Spanning Within Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Page Layout with Tables ........................................................................ 157
Using CSS Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Q&A ................................................................................................... 164
Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
LESSON 10: Understanding the CSS Box Model and Positioning 271
The CSS Box Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Changing the Box Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
The Whole Scoop on Positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
Controlling the Way Things Stack Up ...................................................... 281
Managing the Flow of Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Q&A ................................................................................................... 285
Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
LESSON 11: Using CSS to Do More with Lists, Text, and Navigation 289
HTML List Refresher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
How the CSS Box Model Affects Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Placing List Item Indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Creating Image Maps with List Items and CSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
How Navigation Lists Differ from Regular Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
Creating Vertical Navigation with CSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
Creating Horizontal Navigation with CSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
Q&A ................................................................................................... 314
Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
x Sams Teach Yourself HTML, CSS, and JavaScript All in One
LESSON 21: Working with the Document Object Model (DOM) 523
Understanding the Document Object Model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
Using window Objects ........................................................................... 524
Working with the document Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
Table of Contents xiii