Licensed to botuongxulang@yahoo.com
Summary of Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
1. Setting Up Shop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2. Your First Web Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3. Adding Some Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
4. Shaping Up Using CSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
5. Picture This! Using Images on Your Web Site . . . . . . . . . . . . . . . . . . . . . . . 177
6. Tables: Tools for Organizing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
7. Forms: Interacting with Your Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
8. Launching Your Web Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
9. Adding a Blog to Your Web Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
10. Pimp My Site: Cool Stuff You Can Add for Free . . . . . . . . . . . . . . . . . . . . 377
11. Where to Now? What You Could Learn Next . . . . . . . . . . . . . . . . . . . . . . . 407
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
Licensed to botuongxulang@yahoo.com
Download at Boykma.Com
BUILD YOUR OWN
WEB SITE THE
RIGHT WAY USING
HTML & CSS
BY IAN LLOYD
2ND EDITION
Licensed to botuongxulang@yahoo.com
Download at Boykma.Com
iv
Build Your Own Web Site The Right Way Using HTML & CSS
by Ian Lloyd
Copyright © 2008 SitePoint Pty. Ltd.
Managing Editor: Chris Wyness Editor: Kelly Steele
Technical Editor: Andrew Tetlaw Index Editor: Fred Brown
Technical Editor: Julian Carroll Cover Design: Alex Walker
Technical Director: Kevin Yank Cover Image: Lucas Chan
Printing History:
First Edition: April 2006
Second Edition: November 2008
Notice of Rights
All rights reserved. No part of this book may be reproduced, stored in a retrieval system or transmitted
in any form or by any means, without the prior written permission of the publisher, except in the case
of brief quotations embodied in critical articles or reviews.
Notice of Liability
The author and publisher have made every effort to ensure the accuracy of the information herein.
However, the information contained in this book is sold without warranty, either express or implied.
Neither the authors and SitePoint Pty. Ltd., nor its dealers or distributors will be held liable for any
damages to be caused either directly or indirectly by the instructions contained in this book, or by the
software or hardware products described herein.
Trademark Notice
Rather than indicating every occurrence of a trademarked name as such, this book uses the names only
in an editorial fashion and to the benefit of the trademark owner with no intention of infringement of
the trademark.
Published by SitePoint Pty. Ltd.
48 Cambridge Street
Collingwood VIC Australia 3066
Web: www.sitepoint.com
Email: business@sitepoint.com
ISBN 978-0-9804552-7-4
Printed and bound in the United States of America
Licensed to botuongxulang@yahoo.com
Download at Boykma.Com
v
About the Author
Ian Lloyd is a senior web designer/developer who works full time for a major financial services
organisation in the UK on their various web sites. He is the author or co-author of a number
of web development books, including SitePoint’s Ultimate HTML Reference. He has also
contributed articles to industry-leading sites such as A List Apart, Vitamin and .Net magazine.
Ian has spoken at several high profile web conferences—including South By Southwest
(SXSW) in Austin, Texas and @media in London— on his area of expertise, web accessibility,
and is responsible for the respected online accessibility resource Accessify
(
http://accessify.com/).
Ian lives in Swindon, UK, a town that is known only for two things:
■
the famous “magic roundabout”—a mega roundabout that comprises five individual but
joined roundabouts
■
for being that place from the television show The Office (thus making it second in dullness
only to Slough)
That said, Ian does his best to get out of Swindon in his treasured air-cooled VW camper van
(http://vwkombi.com/) whenever the opportunity (or notoriously grim British weather) allows.
Ian is married to Manda, who doesn’t share the Volkswagen fascination to quite the same
level but enjoys the weekend trips it affords. He takes too many photos, most of them of his
dog
‘Fraggle’ (a mischievous Cairn Terrier), and is still waiting on that elusive lottery win
which will allow them all to head off on travels around the world again.
About The Technical Editors
Andrew Tetlaw has been tinkering with web sites as a web developer since 1997. Before that,
he worked as a high school English teacher, an English teacher in Japan, a window cleaner,
a car washer, a kitchen hand, and a furniture salesman. He is dedicated to making the world
a better place through the technical editing of SitePoint books and kits. He is also a busy
father of five, enjoys coffee, and often neglects his blog at http://tetlaw.id.au/.
Julian Carroll has been designing for the Web since 1996. He manages the SitePoint Solutions
(http://www.sitepoint.com.au/) team, and is a keen sampler of wine. Prior to his career as a
web designer
, he played bass in a rock 'n' roll band.
Licensed to botuongxulang@yahoo.com
Download at Boykma.Com