HTML: a Beginner’S Guide
Total Page:16
File Type:pdf, Size:1020Kb
HTML: A Beginner’s Guide Fourth Edition About the Author Wendy Willard is a freelance consultant offering design and art direction services to clients. She also teaches and writes on these topics, and is the author of several other books including Web Design: A Beginner’s Guide (also published by McGraw-Hill). She holds a degree in Illustration from Art Center College of Design in Pasadena, California, where she first learned HTML in 1995. Wendy enjoys all aspects of digital design, reading, cooking, and anything related to the Web. She lives and works in Maryland with her husband, Wyeth, and their two daughters. About the Technical Editor Todd Meister has been developing and using Microsoft technologies for over ten years. He’s been a technical editor on over 50 titles ranging from SQL Server to the .NET Framework. Besides serving as a technical editor for titles, he is an assistant director for Computing Services at Ball State University in Muncie, Indiana. He lives in central Indiana with his wife, Kimberly, and their four remarkable children. HTML: A Beginner’s Guide Fourth Edition Wendy Willard New York Chicago San Francisco Lisbon London Madrid Mexico City Milan New Delhi San Juan Seoul Singapore Sydney Toronto Copyright © 2009 by The McGraw-Hill Companies. All rights reserved. Except as permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher. ISBN: 978-0-07-161144-2 MHID: 0-07-161144-4 The material in this eBook also appears in the print version of this title: ISBN: 978-0-07-161143-5, MHID: 0-07-161143-6. All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trademark. Where such designations appear in this book, they have been printed with initial caps. McGraw-Hill eBooks are available at special quantity discounts to use as premiums and sales promotions, or for use in corporate training programs. To contact a representative please e-mail us at [email protected]. Information has been obtained by McGraw-Hill from sources believed to be reliable. However, because of the possibility of human or mechanical error by our sources, McGraw-Hill, or others, McGraw-Hill does not guarantee the accuracy, adequacy, or completeness of any information and is not responsible for any errors or omissions or the results obtained from the use of such information. TERMS OF USE This is a copyrighted work and The McGraw-Hill Companies, Inc. (“McGraw-Hill”) and its licensors reserve all rights in and to the work. Use of this work is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to store and retrieve one copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative works based upon, transmit, distribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hill’s prior consent. You may use the work for your own noncommercial and personal use; any other use of the work is strictly prohib- ited. Your right to use the work may be terminated if you fail to comply with these terms. THE WORK IS PROVIDED “AS IS.” McGRAW-HILL AND ITS LICENSORS MAKE NO GUARANTEES OR WAR- RANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE WORK, INCLUDING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PUR- POSE. McGraw-Hill and its licensors do not warrant or guarantee that the functions contained in the work will meet your require- ments or that its operation will be uninterrupted or error free. Neither McGraw-Hill nor its licensors shall be liable to you or any- one else for any inaccuracy, error or omission, regardless of cause, in the work or for any damages resulting therefrom. McGraw-Hill has no responsibility for the content of any information accessed through the work. Under no circumstances shall McGraw-Hill and/or its licensors be liable for any indirect, incidental, special, punitive, consequential or similar damages that result from the use of or inability to use the work, even if any of them has been advised of the possibility of such damages. This limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in contract, tort or otherwise. To Corinna and Caeli—that you might remember your mom once knew some “cool stuff,” even when HTML becomes for you what 8-track tapes are to me. “Heaven and earth will pass away, but my words will never pass away.” —Luke 21:33 This page intentionally left blank Contents at a Glance PART I HTML Basics 1 Getting Started ............................................................ 3 2 Basic Page Structure ...................................................... 21 3 Color ...................................................................... 45 4 Working with Text ......................................................... 55 5 Working with Links ....................................................... 91 6 Working with Images ...................................................... 119 7 Working with Multimedia ................................................. 157 8 Creating Lists ............................................................. 171 9 Using Tables ............................................................... 195 10 Developing Frames ........................................................ 237 11 Employing Forms ......................................................... 263 vii viii HTML: A Beginner’s Guide 12 Positioning Page Elements ................................................ 301 13 HTML for E-Mail ......................................................... 329 PART II Beyond HTML 14 Creating Your Own Web Graphics ........................................ 359 15 Web Content .............................................................. 383 16 Dynamic Content .......................................................... 395 17 Making Pages Available to Others ........................................ 415 PART III Appendixes A Answers to Self Test ....................................................... 437 B HTML/CSS Reference Table .............................................. 465 C Troubleshooting (FAQs) ................................................... 483 D Special Characters ........................................................ 493 E File Types .................................................................. 499 Index ...................................................................... 503 Contents ACKNOWLEDGMENTS ............................................................. xix INTRODUCTION ..................................................................... xxi PART I HTML Basics 1 Getting Started ............................................................ 3 Understand the Internet as a Medium for Disseminating Information ................. 4 The Anatomy of a Web Site ................................................... 4 Web Browsers ................................................................ 7 Internet Service Providers ..................................................... 8 Be Aware of the Current Version of HTML .......................................... 8 Plan for the Audience, Goals, Structure, Content, and Navigation of Your Site . 9 Identify the Target Audience .................................................. 9 Set Goals ..................................................................... 11 Create the Structure ........................................................... 11 Organize Content ............................................................. 11 Develop Navigation ........................................................... 11 Identify the Best HTML Editor for You .............................................. 14 Which Is Best? ................................................................ 16 Learn from the Pros Using the View Source Command of Popular Web Browsers . 17 Summary ........................................................................... 20 ix x HTML: A Beginner’s Guide 2 Basic Page Structure ...................................................... 21 Create an HTML File ............................................................... 22 Naming Conventions .......................................................... 23 Preview an HTML File in a Browser ................................................ 24 Describe and Apply the Basic HTML Document Format ............................. 27 Types of Tags ................................................................. 27 Attributes ..................................................................... 27 Required Tags ................................................................. 28 Doctype ....................................................................... 29 Capitalization ................................................................. 31 Quotations .................................................................... 31 Nesting ....................................................................... 31 Spacing and