HTML A Beginner's Guide, 4th Edition
HTML:
ABeginner’sGuide
FourthEditionAbout the Author WendyWillardisafreelanceconsultantofferingdesignandart
directionservicestoclients.Shealsoteachesandwritesonthese topics,andistheauthorofseveralotherbooksincludingWeb
Design:ABeginner’sGuide (alsopublishedbyMcGraw-Hill).
SheholdsadegreeinIllustrationfromArtCenterCollegeof DesigninPasadena,California,whereshefirstlearnedHTML in1995.
Wendyenjoysallaspectsofdigitaldesign,reading,cooking, andanythingrelatedtotheWeb.ShelivesandworksinMaryland withherhusband,Wyeth,andtheirtwodaughters.
About the Technical Editor
ToddMeisterhasbeendevelopingandusingMicrosoft
technologiesforovertenyears.He’sbeenatechnicaleditoron over50titlesrangingfromSQLServertothe.NETFramework. Besidesservingasatechnicaleditorfortitles,heisanassistant directorforComputingServicesatBallStateUniversityin Muncie,Indiana.HelivesincentralIndianawithhiswife, Kimberly,andtheirfourremarkablechildren. HTML: ABeginner’sGuide FourthEdition
WendyWillard
NewYorkChicagoSanFrancisco LisbonLondonMadridMexicoCity MilanNewDelhiSanJuan SeoulSingaporeSydneyToronto
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 USEThis 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.ToCorinnaandCaeli—thatyoumightrememberyourmomonceknewsome “coolstuff,”evenwhenHTMLbecomesforyouwhat8-tracktapesaretome. “Heavenandearthwillpassaway,butmywordswillneverpassaway.” —Luke21:33
This page intentionally left blank Contents at a Glance
PARTI HTMLBasics 1 GettingStarted . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3
2 BasicPageStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3 Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 4
WorkingwithText . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
WorkingwithLinks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
5
6 WorkingwithImages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 7 WorkingwithMultimedia . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 8 CreatingLists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 9
UsingTables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
10
DevelopingFrames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
11 EmployingForms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
12 PositioningPageElements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 13
HTMLforE-Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
PARTII BeyondHTML 14
CreatingYourOwnWebGraphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
15 WebContent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383 16 DynamicContent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395 17 MakingPagesAvailabletoOthers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415 PARTIII Appendixes A
AnswerstoSelfTest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
HTML/CSSReferenceTable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
B
C Troubleshooting(FAQs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483 D SpecialCharacters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493 E FileTypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
Contents
Contents
Contents
Contents
Contents
This page intentionally left blank
Acknowledgments
hankstoeveryoneatMcGraw-Hillformakingiteasytowriteandupdatethisbook.Thanks tomytechnicaleditorformakingsureeverythingisclear,concise,andaccurate.Thanks
T
tothereadersofthepreviouseditionsforpointingouterrataandsuggestingadditions,soI couldmakethiseditionevenbetterthanthepreviousone.
AspecialthankstoChopPoint,forprovidingthereal-worldprojectforthisbook. Andfinally,Wyeth,Corinna,andCaeli—youaremyinspirationandmyreward.
This page intentionally left blank
Introduction
henIwasfirstapproachedaboutwritingthisbook,Imustadmitthatmythoughtwas, “AnotherHTMLbook—howmanydoweneed?”IlearnedHTMLbyexperiencewhen
W
therewasonlyoneversionofNetscape,andithadbeenalongtimesinceI’devenlookedat anHTMLbook.ButafterIresearchedtheotherHTMLbooksonthemarket,Ifeltcompelled towriteabookthatgivesreadersarealistic,easy-to-understandapproachtolearningHTML, whileatthesametimeofferingreal-worldpracticeactivitiesandadviceonrelatedissues.
HTML:ABeginner’sGuide isthatbook,offeringyoupracticaltoolsandknowledgethat
caneasilybeappliedtoavarietyofdevelopmentsituations,withouttheboringrhetoricor lengthytechnicalfluff.Thisbooktellsyouwhatyouneedtoknow,whenyouneedtoknowit. Inrevisingthisbook,Iagainreviewedcompetingbookstodeterminewhatreaderswantedand neededina“new”HTMLbook.Againandagain,Isawthatyouwantedabookthatcombined HTMLandcascadingstylesheetsinawaythatwaseasytounderstandanduse.Furthermore, readersclamoredforabeginning-levelHTMLbookthatcoveredthestandards-compliantway tocodeusablewebpages.Thisisthatbook.
Who Should Read This Book
SincethisbookisgearedtowardanyonewithlittleornopriorHTMLknowledge,it’sperfect foranyonewishingtolearnHTML.Ifyouareastay-at-homemomwhowantstocreateaweb siteforyourfamily,you’vecometotherightplace.Ifyouareabusinessprofessionalseeking toacquirewebdevelopmentskills,thisisthebookforyou.Ifyouareinterestedinlearning HTML,thisbookisforyou.
Youdon’tneedtoknowanythingaboutcomputerprogrammingorwebdevelopmentin ordertolearnHTML,andyoucertainlydon’tneedtoknoweitherofthosethingstogetalot fromthisbook.
What This Book Covers Thebookisdividedintothreeparts:HTMLBasics,BeyondHTML,andAppendixes
PartI,“HTMLBasics,”coversallyouneedtoknowinordertostartcodingeffective andefficientwebpageswithHTML.PartIconsistsof13chapters,inwhichinformationis brokenupintomanageablechunks.Eachchaptercontainsoneormorestep-by-step,real-world projectstogiveyoupracticeperformingthesuggestedconcepts.InadditiontotheHTML taughttherein,eachchapterprovidesdetailsonhowcascadingstylesheetscanbeusedto accomplishthesameorsimilartechniques.
Chapter1,“GettingStarted,”helpsyouunderstandtheWebbyansweringcommon questionssuchas“WhocreatedHTML?”and“WhomaintainsHTML?”andalsobytackling theanatomyofawebsite,webbrowsers,andHTML.Issuessurroundinghowtoplanyour website,usingHTMLeditors,andlearningfromtheprosarealsodiscussed.
Chapter2,“BasicPageStructure,”explainsbeginningterminology,suchastags,attributes, andnesting,whilealsodescribingnamingconventionsandproperpagestructure. Chapter3,“Color,”givesyoudetailsonhowtoworkwithandreferencecolorinyourweb pages.Hexadecimalcolorandtheweb-safecolorpalettearealsodiscussed. Chapter4,“WorkingwithText,”teachesyouhowtouseHTMLandcascadingstylesheets toformattextwithinyourwebpages,whetherthatmeanschangingthefontstyleorcolor, addinglinebreaksandemphasis.
Chapter5,“WorkingwithLinks,”discussesthecoreofHTML:hypertextlinks.This chaptergivesdetailsonhowtoaddandcustomizelinksinyourwebpages,whetheryou’re linkingtoanotherwebpage,asectiononawebpage,orane-mailaddress.
Chapter6,“WorkingwithImages,”helpsyouuseimagesinyourwebpagesbydescribing differentimagetypes,howtoaddthemtoapage,andhowtolinktoandfromthem.Additional tipsonusingimagesinwebpagesarealsoprovided.
Chapter7,“WorkingwithMultimedia,”explainsdifferenttypesofmultimediayoucanadd toyourpagesandtellshowtodosoinwaysthatworkinmultiplebrowsers. Chapter8,“CreatingLists,”teachesyouhowtocreateandformatthethreedifferenttypes oflistsavailableinHTML,aswellashowtostylethemwithCSS. Chapter9,“UsingTables,”tacklesthesomewhattrickybutveryusefultopicofHTML tables.Instep-by-stepfashion,thischaptertakesyouthroughcreatingaverybasictable structureandthenformattingitwithCSS.
Chapter10,“DevelopingFrames,”offersyouwaystobreakyourwebpagesupinto separatewindowframes,eachwithdifferentpiecesofcontent.Bothstandardandinlineframes arediscussed,aswellashowtoformateach.
Chapter11,“EmployingForms,”discussesakeyingredientformostwebsites—forms providingcommunicationmethodsforcustomers.Varioustypesofinputcontrolsare taught,includingtextfields,checkboxes,fileuploads,selectmenus,andbuttons,aswellas
Introduction
Chapter12,“PositioningPageElements,”tackleshowtomovecontentaroundonthepage withoutevertouchingtheHTMLcodeandonlyupdatingasinglestylesheet. Chapter13,“HTMLforE-Mail,”isabrandnewchapterinthiseditionofthebook,added tohelpwebeditorstranslatewebpagedevelopmentskillstotheworldofHTMLe-mail
(specificallyforbusinessmarketingpurposes).
PartII,“BeyondHTML,”givesyouanintroductionintoseveraladditionalareasrelatedto buildingwebpageswithHTML.Ifyou’reonlyinterestedinlearningHTML,youmightbeableto skipthesesections,butifyou’rewonderingwhatcomesnextafteryoulearnHTML,Irecommend checkingoutthechaptersinPartII.AllofthechaptersinPartIIalsoincludesectionscalled “LearnMore,”whichprovideadditionalresourcesforthoseinterestedinpursuingthetopic.
Chapter14,“CreatingYourOwnWebGraphics,”containsareviewofpopularweb graphicssoftware,aswellasguidelinesyoucanusewhencreatingimagesfortheWeb.This chapteralsodiscussesissuesthatimpactdesigndecisionsandwebgraphicsfileformats.Even ifyoudon’thaveagraphicseditor,thechapterlistsseveralplaceswhereyoucandownload demosforfreetopracticetheconceptstaught.
Chapter15,“WebContent,”discusseswaystoensuretheon-screenreadabilityofyour webpages,howtocreateeffectivelinksandprinter-friendlypages.Inaddition,thischapter providesessentialdosanddon’tsforworkingwithwebcontent.
Chapter16,“DynamicContent,”offersyouanintroductiontoJavaScript,atechnology usedtoadddynamicaspectstootherwisestaticHTMLpages,andDynamicHTML.Sample scriptsallowyoutoaddthecurrentdateandtimetoawebpage,makeformfieldsrequired, andchangepageelementswhenuserspointtothem.
Chapter17,“MakingPagesAvailabletoOthers,”teachesyoutoprepareyourpagesfor onlinedistributionbeforeguidingyouonimportantdecisions,suchaswheretohostyoursite, whatdomainnametouse,andhowtouploadthesite.Testing,submissiontosearchengines anddirectories,andgeneralmarketingtipsarealsodiscussed.
PartIII,“Appendixes,”providesadditionalinformationinquick-referenceformatsandputs commonlyuseddetailsatthefingertipsofbothbeginningandadvancedHTMLcoders. AppendixA,“AnswerstoMasteryCheck,”containstheanswerstothequestionsaskedat theendofeachchapter. AppendixB,“HTML/CSSReferenceTable,”outlinesalloftheHTMLtagsandCSS propertiestaughtinthebookinaneasy-to-readalphabeticalreferenceformat. AppendixC,“Troubleshooting(FAQs),”providesanswerstocommonlyaskedquestions frombeginningandadvancedHTMLcoders. AppendixD,“SpecialCharacters,”liststhecharacterentitiesusedtoembedspecial characters,suchasthecopyrightsymbolandanampersand,intoawebpage. AppendixE,“FileTypes,”includesalistofthefiletypesyouaremostlikelytoencounter whilecreatingwebpages,aswellasabriefdescriptionandMIMEtypeforeach.
How to Read This Book
Thecontentisstructuredsothatyoucanreadasinglechapterasneededortheentirebook fromcovertocover.Whilebeginnersshouldreadthroughthebook,chapterbychapter,in
Theprojectsattheendofeachchapterbuilduponeachother,butyoucouldcertainlyadapt aspecificprojecttoyourownneedsifyoureadthemoutoforder.
Special Features
EachchapterincludesTipsandNotestoprovideadditionalreferenceinformationwherever needed.Detailedcodelistingsareincluded,manytimeswithcertaintagsorfeatureshighlighted withfurtherexplanation.
ManychapterscontainAsktheExpertquestion-and-answersectionstoaddresspotentially confusingissues.EachchaptercontainsTryThisexercisesandstep-by-stepprojectstogive youachancetopracticetheconceptstaughtthusfar.Theseprojectsarebasedonareal-world webdevelopmentprojectIworkedonforanonprofitcalledChopPointinWoolwich,Maine.
SelfTestsareincludedattheendofeachchaptertogiveyouanotherchancetoreviewthe conceptstaughtinthechapter.TheanswerstotheSelfTestsareinAppendixA. YoucandownloadthecontentfortheChopPointprojectsfrommywebsite Throughoutthedevelopmentofthisbook,ourobjectivehasalwaysbeentoprovideyou withacohesive,easy-to-understandguideforcodingHTMLtohelpyougetupandrunning innotime.Asyou’llhearmesaycountlesstimes,HTMLisnotthatdifficultandisdefinitely withinyourreach.IapplaudyourdecisiontolearnHTMLandencourageyoutousethe Internettoitsfullestpotentialbothduringthelearningprocessandinyourensuingweb developmentaspirations.AsChapter1discusses,visitthewebsitesyouloveandlove-to-hate todeterminehowtheyaccomplishedvariousfeatures.Followthelinksidentifiedinthebook foradditionalinformation,anddon’tforgettoperformyourownwebsearchesforrelated content.Havefunandgoodluck! Part
I HTML Basics
This page intentionally left blank Chapter
1 Getting Started KeySkills&Concepts ●
UnderstandtheInternetasaMediumforDisseminatingInformation
●
BeAwareoftheCurrentVersionofHTML
●
PlanfortheAudience,Goals,Structure,Content,andNavigationofYourSite
●
IdentifytheBestHTMLEditorforYou
●
LearnfromtheProsUsingtheViewSourceCommandofPopularWebBrowsers oraslongasI’vebeeninvolvedinmakingwebpages,peoplehaveaskedmetoteachthem theprocess.Atthestart,manyareintimidatedbythethoughtoflearningHTML.Butfear
F
not!Afterall,oneofthereasonsIdecidedtoattendartschoolwastoavoidallthemathand scienceclasses.So,asItellmystudents...ifIcouldlearnHTML,socanyou.
HTMLisnotrocketscience.Quitesimply,itisameansoftellingawebbrowserhow todisplayapage.That’swhyit’scalledHTML,whichistheacronymforHypertextMarkup
Language. Likeanynewskill,HTMLtakespracticetocomprehendwhatyouaredoing.
Beforewediveintotheactualcreationofwebpages,youmustfirstunderstandafew thingsabouttheInternet.Icouldprobablyfillanentirebookwiththematerialinthisinitial chapter,butthefollowingshouldprovideyouwithafirmfoundation.
Understand the Internet as a Medium for Disseminating Information
Whenyou’reaskedtowriteatermpaperinschool,youdon’tsitdownandjuststartwriting. First,youhavetodoresearchandlearnhowtoformatthepaper.Theprocessforwritingand designingawebpageissimilar.
The Anatomy of a Web Site
Undoubtedly,you’veseenafewwebsitesbynow.Perhapsyouknowsomeonewho’saweb guru,andyou’vewatchedhimnavigatethroughawebsitebychoppingoffpiecesoftheweb address.Haveyoueverwonderedwhathe’sdoing?It’snottoodifficult.Hejustknowsalittle abouttheanatomyofawebsiteandhowtheunderlyingstructureislaidout.
URLs
Thefancywordfor“webaddress”isuniformresourcelocator,alsoreferencedbyitsacronym URL(pronouncedeitherbythelettersU-R-Lorasasingleword,url,whichrhymeswith“girl”). Evenifyou’veneverheardawebaddressreferredtoasaURL,you’veprobablyseen one—URLsstartwithhttp://,andtheyusuallyendwith.com,.org,.edu,or.net.(Other possibilitiesinclude.tv,.biz,and.info.Formoreinformation,see EverywebsitehasaURL—forinstance,Google’Thefollowing illustrationshowsanotherexampleofaURLasitappearsinacommonwebbrowser(Firefox) ontheMac.
OnepartofaURListhedomainname,whichhelpsidentifyandlocatecomputersonthe Internet.Toavoidconfusion,eachdomainnameisunique.Youcanthinkofthedomainname asalabelorshortcut.Behindthatshortcutisaseriesofnumbers,calledanIPaddress,which givesthespecificaddressofwherethesiteyou’relookingforislocatedontheInternet.To drawananalogy,ifthedomainnameistheword“Emergency”writtennexttothefirst-aid symbolonyourspeeddial,theIPaddressis9-1-1.
NOTE
Although many URLs begin with “www,” this is not a necessity (depending on how the server is set up). Originally used to denote “World Wide Web” in the URL, using www has caught on as common practice. The characters before the first period in the URL are not part of the registered domain and can be almost anything. In fact, many businesses use this part of the URL to differentiate between various departments within the company. For example, the GO Network includes ABC, ESPN, and Disney, to name a few. Each of these is a department of go.com: abc.go.com, espn.go.com, and disney.go.com. T alias—or a shortcut—for abc.go.com.
Businessestypicallyregisterdomainnamesendingina.com(whichsignifiesacommercial venture)thataresimilartotheirbusinessorproductname.Domainregistrationislikerenting officespaceontheInternet.Onceyouregisteradomainname,youhavetherighttopublisha websiteunderthatnameontheInternetforaslongasyoupaytherentalfees.
TIP
Wondering whether yourname.com is already being used? You can check to see which domain names are still available for registration by visiting a registration service like
Web Servers
Everywebsiteandwebpagealsoneedsawebserver.Quitesimply,awebserverisacomputer, runningspecialsoftware,whichisalwaysconnectedtotheInternet.
NOTE
Some people talk about the computer as the server, as in “We need to buy a new server.” Others call the software the server, saying “We need to install a new web server.” Both uses of the word essentially refer to the same thing—web servers make information available to those requesting it.
WhenyoutypeaURLintoyourwebbrowserorclickalinkinawebpage,yousenda requesttotheserverhousingthatinformation.It’ssimilartotheprocessthatoccurswhenyou dialaphonenumberwithyourtelephone.Yourrequest“calls”thecomputerthatcontainsall thefilesnecessarytoshowyouthewebpageyourequested.Thecomputerthen“serves”and displaysallthepagestoyou,usuallyinyourwebbrowser.
Sites
AURLiscommonlyassociatedwithawebsite.You’vedoubtlessseenplentyofexamplesof suchaddressesonbillboardsandintelevisionadvertising.Fis theURLforAmazon’swebsite,whileistheURLforCBS.
Mostcommonly,thesesitesarelocatedindirectoriesorfoldersontheserver,justasyou mighthaveyourC:driveonyourpersonalcomputer.Then,withinthismainsite,theremaybe severalfolders,whichhouseothersectionsofthewebsite.
I’veheardthephrase“theWorldWideWeb”usedsomanytimes,butI’malittle
confusedaboutwhatitactuallymeansandhowitrelatestotheInternet. TheWorldWideWeb(WWWortheWeb)isoftenconfusedwiththeInternet.Whilethe precursortotheInternetwasoriginallycreatedduringtheColdWarasawaytolink sectionsofthecountrytogetherduringanemergency,theactualterm“Internet”wasn’t useduntiltheearly1970s.Atthattime,academicresearchinstitutionsdevelopedthe Internettocreatebettercommunicationandtoshareresources.Later,universitiesand researchfacilitiesthroughouttheworldbeganusingtheInternet.Intheearly1990s,Tim Berners-LeecreatedasetoftechnologiesthatallowedinformationontheInternetto beconnectedthroughtheuseoflinksindocuments.Thelanguagecomponentofthese technologiesisHypertextMarkupLanguage(HTML).Ifyouwanttofindoutmore,agood resourceonthehistoryoftheInternetisav TheWebwasmostlytext-baseduntilMarcAndreessencreatedthefirstgraphical webbrowserin1993,calledMosaic,whichpavedthewayfortheuseofvideo,sound, andphotosontheNet.Asalargegroupofinterconnectedcomputersallovertheworld, theInternetcomprisesnotonlytheWeb,butalsothingslikenewsgroups(onlinebulletin boards)ande-mail.ManypeoplethinkoftheWebasthegraphicalorillustratedpartof theInternet.
Ask the Expert
Q:
A:
Forexample,ChopPointisasummercampandK–12schoolinMaine.Ithasseveralmain sectionsofitswebsite,butafewinclude“camp,”“school,”“aboutus,”and“store.”Ifyou lookattheURLforChopPoint’s“aboutus”section,youcanseethenameofthefolderafter thesitename:
Ifyouaccessthemainpagefortheschool,theURLchangesto
Pages
Whenyouvisitawebsite,youlookatpagesonthesitethatcontainallitstext,graphics, sound,andvideocontent.Eventhoughawebpageisnotthesamesizeorformatasaprinted page,theword“page”isusedtohelpusdifferentiateamongpages,folders,andsites.The samewaythatmanypagesandchapterscanbecontainedwithinasinglebook,manypages andfolders(orsections)canalsobekeptwithinawebsite.
Mostwebserversaresetuptolookautomaticallyforapagecalled“index”asthemain pageinanyfolder.SoifyouweretotypeintheURLusedinthepreviousexample,theserver wouldlookfortheindexpageinthe“aboutus”folder,whichmightlooklikethefollowing.
Ifyouwanttolookforadifferentpageintheaboutusfolder,youcouldtypethenameof thatpageafterthesiteandfoldernames,keepinginmindthatHTMLpagesusuallyendwith .htmlor.htm,suchasin
Web Browsers
Awebbrowserisapieceofsoftwarethatrunsonyourpersonalcomputerandenablesyouto viewwebpages.Webbrowsers,oftensimplycalled“browsers,”interprettheHTMLcodeand provideavisuallayoutdisplayedonthescreen.Browserstypicallycanalsobeusedtocheck web-basede-mailandaccessnewsgroups.
ThemostpopularbrowserisMicrosoftInternetExplorer(alsocalledIE).Asofthis writing,someestimatesgiveIEupwardof65percentofthemarketshare.Oneexplanation isthatIEcomespreinstalledwithWindowsandfewpeopleseekoutalternativebrowsers. Apple’spreinstalledbrowserwiththeMacO/SisSafari.
Mostoftheotherpopularbrowsersarepartofabreedcalled“Mozilla-based”browsers. ThisnamecomesfromthefactthateachbrowserisbasedonaframeworknamedMozilla, whichhasitsrootsintheoldNetscapebrowser.ThemostpopularMozilla-basedbrowseris Firefox,whichisavailableforbothWindowsandMacoperatingsystems.
TIP
T
Browsersareupdatedregularly,changingtoaddressnewaspectsofHTMLoremerging technologies.Somepeoplecontinuetouseolderversionsoftheirbrowsers,however.This means,atanygiventime,theremaybetwoorthreeactiveversionsofonebrowser,andseveral differentversionsofotherbrowsersbeingemployedbythegeneralpublic.
Whatiftherewereseveralversionsoftelevisions,whichalldisplayedTVprograms differently?Ifthisweretrue,thenyourfavoritetelevisionshowmightlookdifferentevery timeyouwatcheditonsomeoneelse’stelevision.Thiswouldnotonlybefrustratingtoyouas aviewer,itwouldalsobefrustratingfortheshow’screator.
Webdevelopersmustdealwiththisfrustrationeveryday.Becauseofthedifferencesamong variousbrowsersandthelargenumberofcomputertypes,thelookandfeelofawebpagecan varygreatly.Thismeanswebdevelopersmustkeepup-to-dateonthelatestfeaturesofthenew browsers,butwemustalsoknowhowtocreatewebpagesthatarebackward-compatibleforthe olderbrowsersmanypeoplemaystillbeusing.
TIP
Most browsers can be easily customized, meaning you can change the text sizes, styles, and colors, as well as the first page that appears when you start your browser. This is usually called your “home” page or your “start” page, and it’s the page displayed when you click the “home” button in your browser. For easier access, many people change their home page to a search engine or a news site customized according to their needs. These personalized sites are often called portals and also offer free e-mail to users. A few examples are Yahoo!, Google, and MSN.
Internet Service Providers
YouuseanInternetserviceprovider(ISP)togainaccesstotheInternet.Thisconnectioncan bemadethroughyourphonelinewithacompanylikeVerizon,AT&T,AOL,orEarthlink,or youcanconnectthroughacablelinewithacompanylikeComcastorTimeWarner.
Manycompaniesofferyouachoiceofbrowsers,andmayevenprovideaparticularweb browsercustomizedwithquicklinksforthingslikecheckingyoure-mailandreadinglocalnews. However,somecompaniesmaysupportonlyonebrowser,suchasAmericaOnline(AOL).
Be Aware of the Current Version of HTML
Initsearliestyears,HTMLquicklywentthroughmuchiteration,whichledtoalackof standardizationacrosstheInternet.TheWorldWideWebConsortium(W3C— steppedinandbeganpublishingalistofrecommendations,calledstandards,forHTMLand otherweblanguages.ThelastofficialstandardforHTMLwasHTML4.01.
Inanattempttomovethestandardsawayfromtheold-styleHTMLandclosertoamore
2000.Theresultingsetofstandards,calledExtensibleHypertextMarkupLanguage(XHTML), providedawayforHTMLtohandlealternativedevices,suchascellphonesandhandheld computers.
XHTML1.0offeredmanynewfeaturestomakethelivesofwebdeveloperseasier,but itwaspoorlysupportedbywebbrowsersatitslaunchin2001.Intheyearsimmediately following,theW3CupdateditsrecommendationtoXHTML2.0.However,theworlddidn’t adoptXMLasquicklyoraswarmlyastheW3Chadanticipated,andtheorganizationended upswitchinggears.
In2008,theW3Creleasedaworkingdraftofthefutureofhypertextmarkup:HTML5. Thisisverymucha“workinprogress,”whichwilllikelytakeseveralyearstofinalizeand beadopted.Inthemeantime,youcancheckthestatusofHTML5ontheW3C’swebsite:
UnlikeXHTML,HTML5isintendedtoallowthebestofHTMLandXMLsimultaneously. ThedevelopmentteamseekstostudythemodernuseofHTMLanditscontent,inaneffortto createcodestandardsthatwillcarryuseasilyintothenextgenerationoftheWeb.
Althoughthestandardisstillindevelopment,certainkeydifferenceshavebeenidentified. Iwillcallattentiontothoseasneededthroughoutthecourseofthisbook.Youcanreadmore aboutthespecificdifferencesatHowever, youneedn’tactuallycodeforthesedifferencesuntilthemajorityofthebrowsersadopt HTML5.
Plan for the Audience, Goals, Structure, Content, and Navigation of Your Site
Inadditiontolearningaboutthemedium,youalsoneedtodothefollowing:
● Identifyyourtargetaudience. ● Setgoalsforyoursite. ● Createyourwebsite’sstructure. ● Organizeyourwebsite’scontent. ● Developyourwebsite’snavigation.
Identify the Target Audience
Ifyouarecreatingawebsiteforabusiness,agroup,oranorganization,youaremostlikely targetingpeoplewhomightbuyorusethecompany’sproductsorservices.Evenifyour siteissetuppurelyforthepurposeofdisseminatinginformation,youmusttargetacertain audience.Considerwhetheryouhaveexistingresearchregardingyourclientoruserbase.This mightincludedemographics,statistics,orothermarketinginformation,suchasage,gender,and webexperience.
TIP
If your site represents a new company or one that doesn’t already have information about its clients’ demographics, you might check out the competition. Chances are good that if your competition has a successful web site, you can learn from them about your target audience.