CSS Layout model

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.