Cascading Style Sheets Tutorial

Not float to achieve middle layout module

  The most common form of practical layout: on the left, right, at the end of four modules, width 760 px, the overall middle pages. 

  Structure code, top left right foot all four modules independent, non-nested. 

  <div Id="top"> head </ div> 

  <div Id="left"> 
  <div Id="left_module"> left </ div> 
  </ Div> 

  <div Id="right"> 
  <div Id="right_module"> right </ div> 
  </ Div> 

  <div Id="foot"> foot </ div> 

  Top of conventional definition. 

  (# Top height: 100px; background: # ccc; width: 760px; margin: auto; text-align: center;) 

  Method A: definition of the outer left 760 px wide and the middle; lining left_module defined as the actual width of the left side of 280 px, and absolute positioning, top value equivalent to the height of the top of the definition. 
  The advantages of this are: left right two modules code snippet exchange adjustments can be displayed priority. 

  # (Left width: 760px; margin: auto;) 
  # Left_module (width: 280px; position: absolute; top: 100px; padding: 10px;) 

  Method B: left outer defined as 760 px wide and middling, relatively floating in the top; lining left_module defined as the actual width of the left side of 280 px, and absolute positioning. 
  The advantages of this are: the top of a high degree of freedom can be extended. 

  # (Left width: 760px; margin: auto; position: relative;) 
  # Left_module (width: 280px; position: absolute; padding: 10px;) 

  Definition of the outer right width to 760 px and middling, lining right_module defined as the actual width of the right of 440 px, the use of grammar Habitat left margin.    Right_module definition of the actual background color is the right of the background color, height is the actual definition of the middle module height; right of the background color is actually left of the background color. 

  # (Right width: 760px; margin: auto; background: # E8E8E8;) 
  # Right_module (width: 440px; background: # F0F0F0; height: 360px; margin: 0 0 0 auto; padding: 10px;) 

  Belong at the bottom of conventional definition. 

  (# Foot height: 100px; background: # ccc; width: 760px; margin: auto; text-align: center;) 

  IE6.0 and FF1.5 test environment, is the most popular syntax is very simple, practical limited, can be a technical reference. 

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 float, css layout, div css layout, div layout, Float, layout examples

Releated Posts

  • Rational use HTML tags to CSS layout
  • Making Guide website: CSS page layout realization
  • CSS primary entry: (1) The overall layout statement
  • CSS: Beyond the layout grid
  • Common examples of CSS layout

This entry was posted on Saturday, February 2nd, 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.

« Css form of control by the turn color
CSS on »

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