Contents
Grouping Elements with
and
Element
Creating a Form with theElement
Structuring Your Forms withand Elements
Element
Beginning Web Programming with HTML, XHTML, and CSS
Beginning Web Programming with HTML, XHTML, and CSS
Copyright 2004 by Wiley Publishing, Inc. All rights reserved.
Published simultaneously in Canada
No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8700. Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, E-mail: .
LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR OTHER PROFESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOR THE AUTHOR SHALL BE LIABLE FOR DAMAGES ARISING HEREFROM. THE FACT THAT AN ORGANIZATION OR WEBSITE IS REFERRED TO IN THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFORMATION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ.
For general information on our other products and services please contact our Customer Care Department within the United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Trademarks: Wiley, Wrox, the Wrox logo, Programmer to Programmer, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books.
ISBN: 0-7645-7078-1
About the Author
Jon Duckett published his first Web site in 1996 while studying for a BSc (Hons) in Psychology at Brunel University, London. Since then he has helped create a wide variety of Web sites and has co-written more than ten programming-related books on topics from ASP to XML (via many other letters of the alphabet) covering diverse aspects of Web programming including design, architecture, and coding.
After graduation, Jon worked for Wrox Press first in its Birmingham (UK) offices for three years and then in Sydney, Australia, for another year. He is now a freelance developer and consultant based in a leafy suburb of London, working for a range of clients spread across three continents.
When not stuck in front of a computer screen, Jon enjoys listening to music and writing.
Credits
Senior Acquisitions Editor
Jim Minatel
Development Editor
James H. Russell
Production Editor
Eric Newman
Copy Editor
Nancy Rapoport
Editorial Manager
Mary Beth Wakefield
Vice President & Executive Group Publisher
Richard Swadley
Vice President and Executive Publisher
Bob Ipsen
Vice President and Publisher
Joseph B. Wikert
Introduction
There are a lot of books about designing and building Web pages, so thank you for picking up this one. Why do I think it is different? Well, the Web has been around for quite a few years now, and during its life several technologies have been introduced to help you create Web pages, some of which have lasted, others of which have disappeared. Indeed, even enduring technologies such as HTML have had features added and removed over the years. Many books that teach you to write Web pages are revisions of earlier versions of the same book and therefore still take the same approach as the previous edition did. This book, however, is completely new, written from scratch, and its purpose is to teach you how to create Web pages for the Web as it is today and will be for the next few years. Once you have worked through this book, it should continue to serve as a helpful reference text you can keep nearby and dip into when you need to.
About the Book
At the time of this writing, Internet Explorer version 6 and Netscape version 7 are the main Web browsers, and each of the previous versions of these browsers had added new features as the Web developed (and sometimes old features were removed). As all this change might suggest, there is more than one way to build a Web site. For example, if you want to have a heading for a page displayed in a bold, black, Arial typeface, you can achieve this in several ways. However, you can also consider this a very good time to come to the Web, as many of the technologies used to create Web pages are maturing, and favored methods for creating Web sites, or best practices, are emerging.
Writing Web pages today thus requires a balance. On the one hand you want to use the latest and best methods, while on the other hand you have to remember that not everyone who visits your Web site has the latest browser software. So you need to be able to write pages that take advantage of the features of the latest browsers while at the same time ensuring your sites can be viewed in older browsers. (Indeed, if you want to make a living from working on Web pages, you will need to be aware of some of the older ways of doing things.) In this book, I teach you the best practices that you should be learning, and, where necessary, I expose the older techniques that help you achieve the results you want.
Over the past few years there have also been innovations and changes in the way people access the Internet. The Web is no longer just viewed on desktop computers; Web sites are becoming available on devices with small screens, such as mobile phones and PDAs (personal digital assistants), and some devices such as televisions have lower resolutions than computer monitors. There are even stories in the newspapers about how we will all soon have refrigerators and other appliances that will allow us to browse the Web. So, while most of the examples in this book are written for a computer, I will teach you to code your Web pages so that you can make them available to other devices without rewriting your whole site. Learning to code for the emerging generation of applications will make your Web sites and your skills last much longer.