Download full HTML CSS and JavaScript All in One Covering HTML5 CSS3 and ES6 Sams Teach Yourself 3rd Edition Meloni ebook all chapters
Download full HTML CSS and JavaScript All in One Covering HTML5 CSS3 and ES6 Sams Teach Yourself 3rd Edition Meloni ebook all chapters
com
https://ebookmeta.com/product/html-css-and-javascript-all-
in-one-covering-html5-css3-and-es6-sams-teach-yourself-3rd-
edition-meloni/
OR CLICK HERE
DOWLOAD NOW
https://ebookmeta.com/product/sams-teach-yourself-c-in-one-hour-a-
day-9th-edition-siddhartha-rao/
ebookmeta.com
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/
ebookmeta.com
https://ebookmeta.com/product/sams-teach-yourself-sap-in-24-hours-
fourth-edition-george-w-anderson/
ebookmeta.com
https://ebookmeta.com/product/snowflakes-and-holidates-02-riley-ash-
my-hero-holidate-1st-edition-riley-ash/
ebookmeta.com
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/
ebookmeta.com
https://ebookmeta.com/product/black-mental-health-patients-providers-
and-systems-1st-edition-ezra-e-h-griffith/
ebookmeta.com
https://ebookmeta.com/product/eye-yield-ophthalmology-basics-for-
board-and-frcs-part-1-exams-saif-aldeen-saleh-alryalat/
ebookmeta.com
https://ebookmeta.com/product/art-subjects-making-artists-in-the-
american-university-howard-singerman/
ebookmeta.com
https://ebookmeta.com/product/self-care-all-in-one-for-dummies-
shamash-alidina/
ebookmeta.com
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/
ebookmeta.com
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 corpsales@pearsoned.com or (800) 382-3419.
codemantra
For government sales inquiries, please contact governmentsales@pearsoned.com.
For questions about sales outside the U.S., please contact intlcs@pearson.com.
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
So they went to the Six Pine Trees, and threw fir-cones at each other
until they had forgotten what they came for, and they left the basket
under the trees and went back to dinner. And it was just as they were
finishing dinner that Christopher Robin put his head in at the door.
"Where's Pooh?" he asked.
"Tigger dear, where's Pooh?" said Kanga. Tigger explained what had
happened at the same time that Roo was explaining about his Biscuit
Cough and Kanga was telling them not both to talk at once, so it was
some time before Christopher Robin guessed that Pooh and Piglet
and Rabbit were all lost in the mist on the top of the Forest.
"It's a funny thing about Tiggers," whispered Tigger to Roo, "how
Tiggers never get lost."
"Why don't they, Tigger?"
"They just don't," explained Tigger. "That's how it is."
"Well," said Christopher Robin, "we shall have to go and find them,
that's all. Come on, Tigger."
"I shall have to go and find them," explained Tigger to Roo.
"May I find them too?" asked Roo eagerly.
"I think not today, dear," said Kanga. "Another day."
"Well, if they're lost tomorrow, may I find them?"
"We'll see," said Kanga, and Roo, who knew what that meant, went
into a corner, and practised jumping out at himself, partly because he
wanted to practise this, and partly because he didn't want Christopher
Robin and Tigger to think that he minded when they went off without
him.
"The fact is," said Rabbit, "we've missed our way somehow."
They were having a rest in a small sand-pit on the top of the Forest.
Pooh was getting rather tired of that sand-pit, and suspected it of
following them about, because whichever direction they started in,
they always ended up at it, and each time, as it came through the
mist at them, Rabbit said triumphantly, "Now I know where we are!"
and Pooh said sadly, "So do I," and Piglet said nothing. He had tried
to think of something to say, but the only thing he could think of was,
"Help, help!" and it seemed silly to say that, when he had Pooh and
Rabbit with him.
"Well," said Rabbit, after a long silence in which nobody thanked him
for the nice walk they were having, "we'd better get on, I suppose.
Which way shall we try?"
"How would it be," said Pooh slowly, "if, as soon as we're out of sight
of this Pit, we try to find it again?"
"What's the good of that?" said Rabbit.
"Well," said Pooh, "we keep looking for Home and not finding it, so I
thought that if we looked for this Pit, we'd be sure not to find it, which
would be a Good Thing, because then we might find something that
we weren't looking for, which might be just what we were looking for,
really."
"I don't see much sense in that," said Rabbit.
"No," said Pooh humbly, "there isn't. But there was going to be when I
began it. It's just that something happened to it on the way."
"If I walked away from this Pit, and then walked back to it, of course I
should find it."
"Well, I thought perhaps you wouldn't," said Pooh. "I just thought."
"Try," said Piglet suddenly. "We'll wait here for you."
Rabbit gave a laugh to show how silly Piglet was, and walked into the
mist. After he had gone a hundred yards, he turned and walked back
again ... and after Pooh and Piglet had waited twenty minutes for him,
Pooh got up.
"I just thought," said Pooh. "Now then, Piglet, let's go home."
"But, Pooh," cried Piglet, all excited, "do you know the way?"
"No," said Pooh. "But there are twelve pots of honey in my cupboard,
and they've been calling to me for hours. I couldn't hear them
properly before, because Rabbit would talk, but if nobody says
anything except those twelve pots, I think, Piglet, I shall know where
they're calling from. Come on."
They walked off together; and for a long time Piglet said nothing, so
as not to interrupt the pots; and then suddenly he made a squeaky
noise ... and an oo-noise ... because now he began to know where he
was; but he still didn't dare to say so out loud, in case he wasn't. And
just when he was getting so sure of himself that it didn't matter
whether the pots went on calling or not, there was a shout from in
front of them, and out of the mist came Christopher Robin.
"Oh, there you are," said Christopher Robin carelessly, trying to
pretend that he hadn't been Anxious.
"Here we are," said Pooh.
"Where's Rabbit?"
"I don't know," said Pooh.
"Oh—well, I expect Tigger will find him. He's sort of looking for you
all."
"Well," said Pooh, "I've got to go home for something, and so has
Piglet, because we haven't had it yet, and——"
"I'll come and watch you," said Christopher Robin.
So he went home with Pooh, and watched him for quite a long time ...
and all the time he was watching, Tigger was tearing round the Forest
making loud yapping noises for Rabbit. And at last a very Small and
Sorry Rabbit heard him. And the Small and Sorry Rabbit rushed
through the mist at the noise, and it suddenly turned into Tigger; a
Friendly Tigger, a Grand Tigger, a Large and Helpful Tigger, a Tigger
who bounced, if he bounced at all, in just the beautiful way a Tigger
ought to bounce.
"Oh, Tigger, I am glad to see you," cried Rabbit.
CHAPTER VIII
IN WHICH Piglet Does a Very Grand Thing
Half way between Pooh's house and Piglet's house was a Thoughtful
Spot where they met sometimes when they had decided to go and
see each other, and as it was warm and out of the wind they would sit
down there for a little and wonder what they would do now that they
had seen each other. One day when they had decided not to do
anything, Pooh made up a verse about it, so that everybody should
know what the place was for.
"Ah, Piglet," said Owl, looking very much annoyed; "where's Pooh?"