资源描述:
《div css布局入门(Introduction to div css layout)》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、div+css布局入门(Introductiontodiv+csslayout)AreyoulearningtheCSSlayout?AreyoustillnotfullyawareofthepureCSSlayout?Thereareusuallytwosituationsthathinderyourlearning:Thefirstpossibilityisthatyouhaven'tunderstoodtheprincipleofCSSprocessingpages.Beforeyouconsidertheoveral
2、lperformanceofyourpage,youshouldfirstconsiderthesemanticsandstructureofthecontent,andthenaddCSStothesemanticsandstructure.ThisarticlewillshowyouhowtostructureHTML.Anotherreasonisthatyoucan'tdoanythingaboutthefamiliarlayerproperties(suchascellpadding,hspace,align=,l
3、eft,etc.)anddonotknowwhatCSSstatementsshouldbeconvertedto.Whenyou'vesolvedthefirstproblemandknowhowtostructureyourHTML,I'llgiveyoualistofwhattheoriginalperformanceattributesare,andwhatCSSwillbeusedinstead.StructuredHTMLWhenwefirstlearnwebpages,wealwaysthinkabouthow
4、todesign,considerthepictures,fonts,colors,andlayoutschemes.ThenweusePhotoshoporFireworkstodrawoutandcutintosmall.Finally,restoreallofthedesignrestoretothepagebyeditingHTML.IfyouwantyourHTMLpagetohaveaCSSlayout(CSS-friendly),youneedtogobackandconsidertheappearancean
5、dsemanticsofyourpagewithoutfirstthinkingabouttheappearance.Appearanceisnotthemostimportant.AwellstructuredHTMLpagecanberepresentedinanyform,andCSSZenGardenisatypicalexample.CSSZenGardenhelpsuseventuallyrealizethepowerofCSS.HTMLdoesn'tjustreadonthecomputerscreen.You
6、usePhotoshopcarefullydesignedpicturemaynotbedisplayedinthePDA,mobilephoneandscreenreader.Butawell-formedHTMLpagecanbedisplayedanywhere,onanynetworkdevice,throughdifferentdefinitionsofCSS.StartthinkingThefirstthingtolearnis"structure",andsomewritersalsocallitsemanti
7、cs".Thetermmeansthatyouneedtoanalyzeyourcontentblocks,andthepurposeofeachcontentservice,andthenbuildthecorrespondingHTMLstructureforthesecontentpurposes.Ifyousitdowntoanalyzeandplanyourpagestructure,youmaygetafewpieceslikethis:FlagandsitenameMainpagecontentSitenavi
8、gation(mainmenu)SubmenuSearchboxFunctionarea(e.g.shoppingcart,cashier)Footer(copyrightandrelatedlegalstatements)WeusuallyuseDIVelementstodefineth