The CSS contains 3 basic layout models, summarized in English as Flow, Layer, and Float.
In a Web page, elements have three layout models:
1. Flow model
2. Floating model (float)
3. Layers Model (layer)
Flow is the default page layout mode. This means that the HTML page elements in the default state of the Web page are distributed according to the flow model.
The Flow layout (page default) model has 2 more typical features:
1th, the block element extends vertically from top to bottom in the containing element , because, by default, the width of the block element is 100%. In fact, a block element occupies a position in the form of a row. As in the right-hand code editor, the three-block scholar-label (div,h1,p) width is displayed as 100%.
2nd, in the flow model, the inline elements are displayed horizontally from left to right within the containing element in which they are located. (inline elements are not like blocky elements so overbearing exclusive line)
Float is left-aligned, right-aligned, (note that you want to make the two div row display, to ensure that the floating distance is less than the width of the container, the width of the container changes at any time, otherwise it will not fit to move to the next line)
There are three forms of the Layer model: (the layer model shows a more precise position)
1. Absolute Positioning (Position:absolute)
2. relative positioning (position:relative)
3, fixed positioning (position:fixed)
1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8">5 <title>Absolute style</title>6 <styletype= "Text/css">7 Div{8 width:200px;9 Height:200px;Ten Border:2px Red Solid; One position:Absolute; A Right:100px; - Top:20px; - the - } - </style> - </Head> + <Body> - <DivID= "Div1"></Div> + </Body> A </HTML>
CSS Layout model