CSS Grammar Handbook (iv) text fill, border, border and position attributes (ii)

Source: Internet
Author: User
Three, Box boundary properties

1, Margin-bottom
Margin-left
Margin-right
Margin-top

Features: These four properties are used to set the distance between an element and its adjacent elements, which can be defined either as a percentage of length or relative to the width of its parent text, or automatically.
Numerical:
Length-Sets the relative or absolute distance between the corresponding edge of the element and the edge of the box, in units of: mm, CM, in, PX, PT, Pica,ex, em ...
Percent-sets the bounding dimension as a percentage of the parent element's width.
Auto-automatically, this setting takes the default bounds of the browser.
Example

2. Margin

Features: Shorthand property, which is used to set all boundaries of an element. This is the distance that is used to describe the edge of the element's content to the edge of the box. This area is always transparent and you can see the background of the page below.
Numerical:
Length-Ibid.
Percent-sets the bounding dimension as a percentage of the parent element's width.
Auto-automatically, this setting takes the default bounds of the browser.
Example


Four, Box position properties

1. Height

Function: Sets the height of the element, and the browser adjusts the graphic to that height.
Numerical:
Length-mm, CM, px, PT, .....
Auto-Automatic.

2. Width

Function: Sets the width of the element, and the browser adjusts the shape by this width.
Numerical:
Length-mm, CM, in, px, PT, ...
Percent-Sets the drawing size to a percentage of the parent element's width.
Auto-Automatic adjustment

3, float

Function: Used to place elements outside the normal element flow arrangement rules.
Numerical:
None-no change.
Left-places the contents of other elements to the right of the floating element.
Right-places the contents of other elements on the left side of the floating element.

4. Clear

Function: Allows or disables the placement of other elements (usually linear) next to the specified element.
Numerical:
None-Unlimited.
Left-place the element below the floating element
Right-place the element underneath the floating element
Both-element is not allowed to place floating elements on either side

The above is the CSS Grammar Manual (four) text fill, border, border and position attributes (ii), more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!

  • 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.