Cascading Style Sheets Tutorial

Rational use HTML tags to CSS layout

  High CSS layout has been gradually pandemic, in the face of the so-called DIV + CSS layout of the name more worried about people not to let DIV become a substitute for the Table, multi-nested DIV will seriously affect the code can be read, apply HTML provide us with the label it. 

  What time should DIV? 

  Although in this respect there is no hard and fast rules, but personally think that DIV more general framework applicable to the position. For example, we head to the definition of a region, so the general definition of a DIV: 

  <div Id="header"> This is the framework of the head to write the contents of </ div> 

  Of course, the class can be used to define, but generally the same as in the pages will not repeat elements can be better used id to distinguish. 

  I observed under the Home alistapart code, which defined the head of the code are as follows: 

  The following is quoted fragment: 
  <ul Id="navbar"> 
  <li Id="articles"> 
  <a Href="/articles/" title="Articles"> Articles </ a> </ li> 
  <li Id="topics"> 
  <a Href="/topics/" title="Topics"> Topics </ a> </ li> 
  <li Id="about"> 
  <a Href="/about/" title="About"> About </ a> </ li> 
  <li Id="contact"> 
  <a Href="/contact/" title="Contact"> Contact </ a> </ li> 
  <li Id="contribute"> 
  <a Href="/contribute/" title="Contribute"> Contribute </ a> </ li> 
  <li Id="feed"> 
  <a Href="/feed/" title="Feed"> Feed </ a> </ li> 
  </ Ul> 
  <h1 Id="masthead"> 
  <a Href="/"> 
  <img Src="/pix/alalogo.gif" alt="A LIST Apart: For People Who Make Websites" /> 
  </ A> 
  </ H1> 

  The following is quoted fragment: 
  <div Id="ish"> 
  <a Href="/issues/214" title="Issue 214"> No. <em> 214 </ em> </ a> 
  </ Div> 

  Results visit: ALA 
  Defines the top of the navigation (ul), the left of the logo and that the round No.xxxx markings. 

  He did not make use of DIV top of the framework, but the good that the use of these codes, and why? Apply because he provided the HTML tags, as well as the name of the definition of style 

  The layout of the most commonly used other labels 

  H1 

  Perhaps the label that it is truly to be used rarely, because it really shows that the font is too "big", but we are CSSer, what label styles can not be changed? And it can express the meaning of the original as it role as obvious (the title) I think you already know how to use it to the ^ _ ^ 

  Ul 

  This label is used to a lot of navigation part of the definition, of course, ol also can be used to replace, but there is no order of navigation links at the bar, or to use the more precise ul (remove the more obvious effects CSS) 

  B 

  This is no longer recommend the use of labels in the layout, able to bring a lot of convenience (short), although I am not too much in favour of the use of this label, but some time (for example, the layout of the local small definition) or good choice 

  H2 

  H2 use should not place with the largest distribution, but on the subheading, but some places need to define the pattern of columns, with a more appropriate label, the contents of columns on the use of p 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • DotNetKicks
  • DZone

Tags: css layout, div css layout, div layout, html, layout examples, w3c html

Releated Posts

  • CSDN, creating the most personality Blog layout (HTML + CSS)
  • HTML thorough analysis (4) layout marking
  • Making Guide website: CSS page layout realization
  • CSS primary entry: (1) The overall layout statement
  • CSS: Beyond the layout grid

This entry was posted on Monday, February 11th, 2008 at 12:00 am and is filed under Css+Div Web Design. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

« Resource sharing: Learning CSS related resources website

Leave a Reply

  • Categories

    • CSS Properties (491)
    • CSS Tutorial (1154)
    • CSS Tutorial By Examples (1201)
    • Css+Div Web Design (3274)
    • Xhtml and Web Design (1797)
  • Archives

    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • October 2007
    • September 2007
    • August 2007
    • July 2007
    • June 2007
    • May 2007
    • April 2007
    • March 2007
    • February 2007
    • January 2007
  • Pages

    • About us

Cascading Style Sheets Tutorial