Sams Teach Yourself HTML and CSS in 24 Hours
Eighth Edition
Julie Meloni
Michael Morrison
800 East 96th Street, Indianapolis, Indiana, 46240 USA
Sams Teach Yourself HTML and CSS in 24 Hours, Eighth Edition
Copyright 2010 by Sams Publishing
All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher. No patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions. Nor is any liability assumed for damages resulting from the use of the information contained herein.
International Standard Book Number: 0-672-33097-0
Library of Congress Cataloging-in-Publication Data
Meloni, Julie C.
Sams teach yourself HTML and CSS 24 hours / Julie Meloni, Michael
Morrison. -- 8th ed.
p. cm.
Rev. ed. of: Sams teach yourself HTML and CSS in 24 hours / Dick
Oliver, 7th ed., 2006.
ISBN 978-0-672-33097-1 (pbk.)
1. HTML (Document markup language) 2. XHTML (Document markup
language) 3. Cascading style sheets. I. Morrison, Michael, 1970- II.
Oliver, Dick. Sams teach yourself HTML and CSS in 24 hours. III. Title.
QA76.76.H94O4526 2010
006.74--dc22
2009046100
Printed in the United States of America
First Printing: December 2009
Trademarks
All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized. Sams Publishing 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 or service mark.
Warning and Disclaimer
Every effort has been made to make this book as complete and as accurate as possible, but no 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 loss or damages arising from the information contained in this book or from the use of the CD or programs accompanying it.
Bulk Sales
Sams Publishing offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales. For more information, please contact
U.S. Corporate and Government Sales
1-800-382-3419
For sales outside of the U.S., please contact
International Sales
Acquisitions Editor
Mark Taber
Development Editor
Michael Thurston
Managing Editor
Patrick Kanouse
Project Editor
Jennifer Gallant
Indexer
Ken Johnson
Proofreader
Dan Knott
Technical Editor
William Wolff
Publishing Coordinator
Vanessa Evans
Composition
Mark Shirar
Book Designer
Gary Adair
Contents
Appearance
About the Authors
Julie C. Meloni is both the technical director for i2i Interactive, a multimedia company located in Los Altos, CA, and a scholar working in the field of Digital Humanities. She has written several books and articles on Web-based programming languages and database topics, including the bestselling Sams Teach Yourself PHP, MySQL, and Apache All in One.
Michael Morrison is a writer, developer, toy inventor, and author of a variety of computer technology books and interactive web-based courses. In addition to his primary profession as a writer and freelance nerd for hire, Michael is the creative lead at Stalefish Labs, an entertainment company he co-founded with his wife, Masheed.
We Want to Hear from You!
As the reader of this book, you are our most important critic and commentator. We value your opinion and want to know what were doing right, what we could do better, what areas youd like to see us publish in, and any other words of wisdom youre willing to pass our way.
You can email or write me directly to let me know what you did or didnt like about this bookas well as what we can do to make our books stronger.
Please note that I cannot help you with technical problems related to the topic of this book, and that due to the high volume of mail I receive, I might not be able to reply to every message.
When you write, please be sure to include this books title and author as well as your name and phone or email address. I will carefully review your comments and share them with the author and editors who worked on the book.
Email:
Mail: Mark Taber
Associate Publisher
Sams Publishing
800 East 96th Street
Indianapolis, IN 46240 USA
Reader Services
Visit our web site and register this book at informit.com/register for convenient access to any updates, downloads, troubleshooting hints, or errata that might be available for this book.
Introduction
In 2009, it is estimated that more than 1.5 billion people have access to the Internet, including 220 million in the U.S. alone. Throw in 338 million Chinese users, 55 million German users, 48 million British users, 38 million Russian users, and 67 million Brazilians, and you can see the meaning of the word world in the term World Wide Web. Many of these Internet users are also creating content for the Webyou can be one of them! Although accurate measurements of the total number of web pages are difficult to come by, Googles most recent data indicates they hit the 1 trillion mark of indexed pages in the middle of 2008.
In the next 24 hours, hundreds of millions of new pages will appear in accessible areas of the Internet. At least as many pages will be placed on private intranets, where they will be viewed by businesspeople connected via their local networks. Every one of those pageslike the more than 1 trillion pages already onlinewill use Hypertext Markup Language (HTML).
As you complete the 24 one-hour lessons in this book, your web pages will be among those that appear on the Internet. These lessons will also help you develop one of the most valuable skills in the world today: mastery of HTML.
Can you really learn to create top-quality web pages yourself, without any specialized software, in less time than it takes to schedule and wait for an appointment with a highly paid HTML wizard? Can this relatively short, easy-to-read book really enable you to teach yourself state-of-the-art web page publishing?
Yes. In fact, within the first two lessons in this book, someone with no previous HTML experience at all can have a web page ready to place on the web.
How can you learn the language of the Web so fast? By example. This book organizes HTML into simple steps and then shows you exactly how to tackle each step. Every HTML code example is listed directly before a picture of the web page it produces. You see how its done, you read a clear, concise explanation of how it works, and then you immediately do the same thing with your own page. Ten minutes later, youre on to the next step.
After 24 hours of work, youre marveling at your own impressive pages on the Internet.
Beyond HTML
This book covers more than just HTML because HTML isnt the only thing you need to know to create web content today. The goal of this book is to give you all the skills you need to create a modern, standards-compliant web site in just 24 short, easy lessons. This book covers the following key skills and technologies: