HTML5 and CSS3
Visual QuickStart Guide
Seventh Edition
Elizabeth Castro
Bruce Hyslop
HTML5 and CSS3, Seventh Edition: Visual QuickStart Guide
Elizabeth Castro and Bruce Hyslop
Peachpit Press
1249 Eighth Street
Berkeley, CA 94710
510/524-2178
510/524-2221 (fax)
Find us on the Web at www.peachpit.com.
To report errors, please send a note to .
Peachpit Press is a division of Pearson Education.
Copyright 2012 by Elizabeth Castro and Bruce Hyslop
Editor: Clifford Colby
Development editor: Robyn G. Thomas
Production editor: Cory Borman
Compositor: David Van Ness
Copyeditor: Scout Festa
Proofreader: Nolan Hester
Technical editors: Michael Bester and Chris Casciano
Indexer: Valerie Haynes Perry
Cover design: RHDG/Riezebos Holzbaur Design Group, Peachpit Press
Interior design: Peachpit Press
Logo design: MINE www.minesf.com
Notice of Rights
All rights reserved. No part of this book may be reproduced or transmitted in any form by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. For information on getting permission for reprints and excerpts, contact .
bart.gov screen shots courtesy of San Francisco Bay Area Rapid Transit District (BART).
css3generator.com screen shots courtesy of Randy Jensen.
dribbble.com screen shots courtesy of Dan Cederholm.
fontsquirrel.com screen shots courtesy of Ethan Dunham.
foodsense.is screen shots courtesy of Julie Lamba.
modernizr.com screen shots courtesy of Faruk Ates.
namecheap.com screen shots courtesy of Namecheap.
Notice of Liability
The information in this book is distributed on an As Is basis without warranty. While every precaution has been taken in the preparation of the book, neither the authors nor Peachpit shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the instructions contained in this book or by the computer software and hardware products described in it.
Trademarks
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 Peachpit was aware of a trademark claim, the designations appear as requested by the owner of the trademark. All other product names and services identified throughout this book are used in editorial fashion only and for the benefit of such companies with no intention of infringement of the trademark. No such use, or the use of any trade name, is intended to convey endorsement or other affiliation with this book.
ISBN-13: 978-0-321-71961-4
ISBN-10: 0-321-71961-1
9 8 7 6 5 4 3 2 1
Printed and bound in the United States of America
To family.
Acknowledgments
Writing the acknowledgments is one of the most daunting challenges of working on a book, because you want to be sure to convey your appreciation of everyone properly. This book is the result of the support, tireless work, and good spirits of a lot of people. I hope to do them all justice, and I hope that youll indulge me for a bit while I thank them.
A most sincere thank you goes out to:
Nancy Aldrich-Ruenzel and Nancy Davis, for entrusting me with this edition of a book that has been important to Peachpit for many years.
Cliff Colby, for recommending me and making this possible; for his confidence in me and his patience, flexibility, and guidance; and for countless conversations and lots of laughs.
Robyn Thomas, for her tremendous effort in keeping us all on track, wrangling countless documents, making thoughtful edits and suggestions, and providing regular words of encouragement, which were always a boost.
Michael Bester, for all the spot-on feedback and suggestions, catching technical errors and omissions, and helping us get the right message across to readers. It was a real pleasure working with him on another book.
Chris Casciano, in the same vein, for all your technical expertise, suggestions, and crucial feedback. I really appreciated your joining us in the final weeks; we were lucky to have you.
Cory Borman, for expertly overseeing the production of the book and creating diagrams in a pinch, and for his good humor.
Scout Festa, for carefully correcting grammar and punctuation, tightening up language, ensuring the accuracy of figure and chapter references, and, overall, providing an all-important level of polish.
David Van Ness, for his great care laying out the pages and for his proficiency and attention to detail.
Nolan Hester, for lending his expertise to the effort of reviewing the laid-out pages.
Valerie Haynes Perry, for handling the critical task of creating an effective index on which readers will rely time and again.
The numerous marketing, sales, and other folks at Peachpit for working behind the scenes to make the book successful.
My family and friends, for checking in on my progress and providing occasional, welcome breaks from writing. Thanks to those friends in particular who probably tired of hearing me say often that I couldnt get together, but who kept asking anyway.
Robert Reinhardt, as always, for getting me started in writing books and for his guidance as I was embarking on this one.
The Web community, for your innovations and for sharing your knowledge so that others may benefit (Ive cited many of you throughout the book).
To you readers, for your interest in learning about HTML and CSS and for selecting this book; I know you have a lot of others from which to choose. I hope the book serves you well.
in the book. Readers who see them on the books site will surely appreciate your work.
In alphabetical order by last name, the contributing authors are:
Scott Boms ()
Scott is an award-winning designer, writer, and speaker who has partnered with organizations such as PayPal, HSBC, Hyundai, DHL, XM Radio, Toronto Life magazine, and Masterfile during his more than 15 years of working on the Web. When hes away from the computer, you might find him shooting Polaroids; playing drums with his band, George; or enjoying time with his wonderful wife and two children. Hes @scottboms on Twitter.
Ian Devlin ()
Ian Devlin is an Irish Web developer, blogger, and author who enjoys coding and writing about emerging Web technologies such as HTML5 and CSS3. In addition to front-end development, Ian also builds solutions with back-end technologies such as .NET and PHP. He has recently written a book, HTML5 Multimedia: Develop and Design (Peachpit Press, 2011).
Seth Lemoine ()
Seth Lemoine is a software developer and teacher in Atlanta. For over ten years, hes worked on challenging projects to see whats possible, with technologies from HTML, JavaScript, and CSS to Objective-C and Ruby. Whether its finding innovative ways to teach HTML5 and CSS to his students or perfecting a Schezuan recipe in his outdoor wok, being creative is his passion.
Erik Vorhes (Appendixes A and B, available on the books Web site)
Erik Vorhes creates things for the Web with VSA Partners and is managing editor for Typedia (http://typedia.com/). He lives and works in Chicago.
Brian Warren ()
Brian Warren is a senior designer at Happy Cog in Philadelphia. When hes not writing or designing, he spends his time playing with his beautiful family, listening to music, and brewing beer. He blogs, intermittently, at http://begoodnotbad.com.