css--Layout model

Source: Internet
Author: User

1. Three layout models:

Mobile Model Flow

Float model Float

Layers Model Layer

2. Flow model:

Default layout mode.

Characteristics:

Block elements are spread vertically from top to bottom in the containing element, and the default block element has a width of 100% and occupies the position as a row.

Inline elements are displayed horizontally from left to right within the containing element, such as a, span, EM, strong.

3. Floating Model:

The way in which the block elements are displayed side-by.

Float:left, right

Xxx{float:left;}

4. Layer Model:

The way that elements are positioned precisely in a Web page.

> Three different forms:

Absolute positioning (absolute), relative positioning (relative), fixed positioning

1> Absolute Positioning:

Position:absolute

Leave the element out of the document flow, and then use the left, Righ, top, and bottom properties to absolutely locate the parent containing block that has the closest position property relative to it. If no such inclusion block exists, then relative to the body element, that is, relative to the browser window.

2> Relative positioning:

Position:relative

The offset of an element in the normal document stream is determined by attributes such as Lef. The upper-left corner is the origin of the coordinates.

The element is offset, but the position before the offset is left intact, overwriting the previous Div without the position before the offset.

3> Fixed positioning:

Position:fixed

Similar to absolute, but the coordinates of its relative movement are the view (the page window within the screen) itself.

Because the view itself is fixed, it does not change with the scroll bars of the browser window.

Unless you move the screen position of the browser window on the screen, or change the display size of the browser window, the anchored element is always located somewhere in the view in the browser window and is not affected by the flow of the document.

>relative and Absolute Combined: The parent element is Relative/absolute, and the anchor element uses absolute.

  

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.