Css+div Box Model Research Notes

Source: Internet
Author: User

The red flag is the default value

1, border (border): Border-top,border-bottom,border-left,border-right

1.border-color (border color);

2.border-width (Border thickness): medium|thin|thick| value;

3.border-style (Border style): none|hidden|dotted|dashed|solid|

2, padding (inner margin):p Adding-top,padding-bottom, Padding-left,padding-right

3, margin (margin): Margin-top,margin-bottom, Margin-left,margin-right

When margin is set to a negative number, the block that is set to a negative number moves in the opposite direction, and the setting is overlaid on the other block. When a parent-child relationship is between blocks, you can detach a block of text from the parent block by setting the margin of the child block to a negative number.

4, Background-color: (background color)

1. When setting the Background-color background color for an element, IE is content+padding, while Firefox is Content+padding+border.
The 2.body is a special box whose background color extends to the margin section.

Abbreviated form of the attribute:

1. If 2 attribute values are given, the former represents the upper and lower attributes, the latter representing the left and right properties.

2. If 3 attribute values are given, the former represents the attributes on, the middle value represents the left and right properties, and the latter represents the properties under.

3. If 4 attribute values are given, then the top, right, bottom, and left properties are then sorted clockwise.

Classification of elements

1. Block-level element (block): one row

Vertical Margin=max between block-level elements Div1 and Div2 (Margin_bottom,div2 of Div1 Margin-top)

2. In-line element (inline)

Horizontal margin= between inline elements span1 and span2 (span1 margin-right) + (span2 margin-left)

The float of the box:

1. Set float: float:none|left|right

2. Clear float: clear:none|left|right|both

Css+div Box Model Research Notes

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.