ptg
ptg
HTML
Manual of Style
From the Library of Wow! eBook
ptg
This page intentionally left blank
From the Library of Wow! eBook
ptg
HTML
M S
A Clear, Concise Reference for Hypertext
Markup Language (Including HTML)
Fourth Edition
Larry Aronson
Upper Saddle River, NJ • Boston • Indianapolis • San Francisco
New York • Toronto • Montreal • London • Munich • Paris • Madrid
Cape Town • Sydney • Tokyo • Singapore • Mexico City
From the Library of Wow! eBook
ptg
Many of the designations used by manufacturers and sellers to distinguish their
products are claimed as trademarks. Where those designations appear in this book,
and the publisher was aware of a trademark claim, the designations have been printed
with initial capital letters or in all capitals.
e author and publisher have taken care in the preparation of this book, but make
no expressed or implied warranty of any kind and assume no responsibility for errors
or omissions. No liability is assumed for incidental or consequential damages in
connection with or arising out of the use of the information or programs contained
herein.
e publisher oers excellent discounts on this book when ordered in quantity for
bulk purchases or special sales, which may include electronic versions and/or custom
covers and content particular to your business, training goals, marketing focus, and
branding interests. For more information, please contact:
U.S. Corporate and Government Sales
800-382-3419
For sales outside the United States, please contact:
International Sales
Visit us on the Web: informit.com/aw
Library of Congress Cataloging-in-Publication Data:
Aronson, Larry.
HTML manual of style : a clear, concise reference for hypertext markup language
(including HTML5) / Larry Aronson.
p. cm.
ISBN 978-0-321-71208-0 (pbk. : alk. paper)
1. Hypertext systems. 2. HTML (Document markup language) I. Title.
QA76.76.H94A7624 2010
006.7’4 dc22
2010031013
Copyright © 2011 Pearson Education, Inc.
All rights reserved. Printed in the United States of America. is publication is pro-
tected by copyright, and permission must be obtained from the publisher prior to any
prohibited reproduction, storage in a retrieval system, or transmission in any form
or by any means, electronic, mechanical, photocopying, recording, or likewise. For
information regarding permissions, write to:
Pearson Education, Inc.
Rights and Contracts Department
501 Boylston Street, Suite 900
Boston, MA 02116
Fax 617-671-3447
ISBN-13: 978-0-321-71208-0
ISBN-10: 0-321-71208-0
Text printed in the United States on recycled paper at RR Donnelley in
Crawfordsville, IN.
Editor-in-Chief
Mark Taub
Acquisitions Editor
Trina MacDonald
Development Editor
Songlin Qiu
Managing Editor
Kristy Hart
Project Editor
Anne Goebel
Copy Editor
Gayle Johnson
Indexer
Erika Millen
Proofreader
Apostrophe Editing Services
Technical Reviewers
Elliotte Rusty Harold
Benjamin Schupak
Publishing Coordinator
Olivia Basegio
Interior Designer
Bumpy Design
Cover Designer
Anne Jones
From the Library of Wow! eBook
ptg
is book is dedicated to my wife, Heidi Cohen,
a much better writer than I am, who provided encouragement
and inspiration throughout the project.
It was also written in fond memory of people who were
major forces in my life, especially my parents,
Manny and Dorothy Aronson, and my
friends Andy Cohen, Bobo Lewis, Milan Stitt, and
Lynne igpen.
From the Library of Wow! eBook
ptg
Contents at a Glance
Acknowledgments xii
About the Author xiii
Preface xiv
1 HTML and the Web 2
2 e HTML Language 24
3 Elements of Style 114
4 Using HTML 180
5 Building Websites 208
A HTML5 Quick Reference 267
B CSS Properties 279
Index 305
From the Library of Wow! eBook
ptg
Table of Contents
Acknowledgments xii
About the Author xiii
Preface xiv
Chapter 1 HTML and the Web 2
HTML: e Language of the Web 3
A Bit of Web History 7
Hypertext Content and Online Media 11
Uniform Resource Locators (URLs) 11
Web Browsers and Servers 12
e Web Bestiary 15
HTML5 and Web Standards 19
Do We All Have to Learn HTML5 Now? 21
Summary 21
Chapter 2 The HTML Language 24
Language Overview 25
Page Structure and the DOM 31
HTML5 Syntax 35
Comments 35
Character Entities 36
Markup Elements 37
HTML5 Semantics 40
HTML Attributes 51
Event Handlers 55
From the Library of Wow! eBook
ptg
Block Elements 57
Headings 57
Paragraphs, Block Quotes, and Address Blocks 61
Lists 67
Division and Section Elements 73
Tables 77
Links and Anchors 85
Uniform Resource Locators 86
Anchor States 88
Anchor Attributes 89
Inline Images 90
Audio and Video 95
Input Forms 99
e HTML5 Canvas 110
Summary 113
Chapter 3 Elements of Style 114
Cascading Style Sheets 115
CSS Selectors 119
Pseudo-Classes and Pseudo-Elements 124
Typography 128
Font Style 131
Font Weight 131
Font Variant 132
Font Size 132
Font 136
Colors 138
Background Properties 141
Text Properties 144
text-align 144
text-decoration 144
From the Library of Wow! eBook
ptg
text-indent 146
text-transform 146
line-height 146
Letter and Word Spacing 148
white space 150
vertical-align 150
Box Properties 152
Height and Width 153
Margins and Padding 154
Borders 157
List Styles 161
CSS Positioning 166
Other CSS Properties 171
Display and Visibility 172
Overow 177
Float and Clear 177
Summary 178
Chapter 4 Using HTML 180
Tools of the Trade 182
Blogging 185
Google Docs 192
eBay Selling 198
Wikipedia 200
HTML Email 203
Summary 207
Chapter 5 Building Websites 208
Development Approaches 209
Content or Service Site? 211
Static or Dynamic Content? 212
From the Library of Wow! eBook