About CSS box-model and Flow

Source: Internet
Author: User

From: http://www.brainjar.com/css/positioning/default.asp
Box:
1. margins are always transparent.
2. background settings aplly to padding and content areas.
3. The width and height of each box is equal to the width and height of the outer margin box.
4. the browser window serves as the root box.
5. There are two basic types of boxes: block (generated by elements such P/Div/table ) And inline (generated by tags such B/I/span And actual content like text and images ).
6. In normal flow, block boxes flow vertically starting at the top of theire containing block, inline boxes flow horizontally from left to right.
7. If you setDisply To None , No box is created. The browser acts as if the element did not exist.
Flow:
1. there three positioning models: Normal, float and absolute.
2. In normal flow, vertical margins are collapsed. Horizontal margins are never collapsed.
3. Position: relative has no influnce on other blocks t for it's children, it just move itself to some offset.
4. floated boxes are always treated as block boxes, even if they are defined using inline elements.
5. If Position Is set Absolute Or Fixed , The element is removed from the normal flow and have no effect on boxes in the flow.
6. for relative positioning, offsets are measured from the element's "shocould-have-been" position in the normal flow, an absolutely positioned element is offset from its container block (has a position Absolute/relative/fixed ).

Related Article

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.