About This E-Book
EPUB is an open, industry-standard format for e-books. However, support for EPUB and its many features varies across reading devices and applications. Use your device or app settings to customize the presentation to your liking. Settings that you can customize often include font, font size, single or double column, landscape or portrait mode, and figures that you can click or tap to enlarge. For additional information about the settings and features on your reading device or app, visit the device manufacturers Web site.
Many titles include programming code or configuration examples. To optimize the presentation of these elements, view the e-book in single-column, landscape mode and adjust the font size to the smallest setting. In addition to presenting code and configurations in the reflowable text format, we have included images of the code that mimic the presentation found in the print book; therefore, where the reflowable format may compromise the presentation of the code listing, you will see a Click here to view code image link. Click the link to view the print-fidelity code image. To return to the previous page viewed, click the Back button on your device or app.
Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day
Seventh Edition
Laura Lemay
Rafe Coburn
Jennifer Kyrnin
800 East 96th Street, Indianapolis, Indiana 46240
Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day, Seventh Edition
Copyright 2016 by Pearson Education, Inc.
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.
ISBN-13: 978-0-672-33623-2
ISBN-10: 0-672-33623-5
Library of Congress Control Number: 2015918052
Printed in the United States of America
First Printing December 2015
Acquisitions Editor
Mark Taber
Managing Editor
Sandra Schroeder
Senior Project Editor
Tonya Simpson
Copy Editor
Keith Cline
Indexer
Tim Wright
Proofreader
Gill Editorial Services
Editorial Assistant
Vanessa Evans
Cover Designer
Mark Shirar
Compositor
Bronkella Publishing
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 authors 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.
Special Sales
For information about buying this title in bulk quantities, or for special sales opportunities (which may include electronic versions; custom cover designs; and content particular to your business, training goals, marketing focus, or branding interests), please contact our corporate sales department at or (800) 382-3419.
For government sales inquiries, please contact .
For questions about sales outside the U.S., please contact .
Contents at a Glance
Table of Contents
Tag
Attributes of the
Tag
The and
Tags
The Element
Using theTag
About the Authors
Rafe Colburn is an author and web developer with more than 15 years of experience building websites. His other books include Special Edition Using SQL and Sams Teach Yourself CGI in 24 Hours. You can read his blog at http://rc3.org or find him on Twitter as @rafeco.
Jennifer Kyrnin is an author and web designer who has been working on the Internet since 1995. Her other books include Sams Teach Yourself Bootstrap in 24 Hours, Sams Teach Yourself Responsive Web Design in 24 Hours, and Sams Teach Yourself HTML5 Mobile Application Development in 24 Hours. She can be found at http://htmljenn.com/ or on Twitter as @htmljenn.
Laura Lemay is one of the worlds most popular authors on web development topics. She is the original author of Sams Teach Yourself Web Publishing with HTML, Sams Teach Yourself Java in 21 Days, and Sams Teach Yourself Perl in 21 Days.
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.
We welcome your comments. You can email or write to let us know what you did or didnt like about this bookas well as what we can do to make our books better.
Please note that we cannot help you with technical problems related to the topic of this book.
When you write, please be sure to include this books title and author as well as your name and email address. We will carefully review your comments and share them with the author and editors who worked on the book.
Email:
Mail: Sams Publishing
ATTN: Reader Feedback
800 East 96th Street
Indianapolis, IN 46240 USA
Reader Services
Register your copy of Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day (ISBN 978-0-672-33623-2) at informit.com/register for convenient access to downloads, updates, and corrections as they become available.
Introduction
Over the past decade, the Web has become completely integrated into the fabric of society. Most businesses have websites, and its unusual to see a commercial on television that doesnt display a URL. The simple fact that most people know what a URL is speaks volumes. People who didnt know what the Internet was several years ago are now reconnecting with their high school friends on Facebook.
Perhaps the greatest thing about the Web is that you dont have to be a big company to publish things on it. The only things you need to create your own website are a computer with access to the Internet and the willingness to learn. Obviously, the reason youre reading this is that you have an interest in web publishing. Perhaps you need to learn about it for work, or youre looking for a new means of self-expression, or you want to post baby pictures on the Web so that your relatives all over the country can stay up-to-date. The question is, how do you get started?
Theres more than enough information on the Web about how to publish websites like a seasoned professional. There are tutorials, reference sites, tons of examples, and free tools to make it easier to publish on the Web. However, the advantage of reading this book instead is that all the information you need to build websites is organized in one place and presented in an orderly fashion. It has everything you need to master HTML, publish sites to a server on the Web, create graphics for use on the Web, and keep your sites running smoothly.