CSS Grammar Manual (iv) text padding, border, boundary, and position attributes (ii)

Source: Internet
Author: User
Tags manual relative
css| Syntax

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 and can be defined either as a percentage of the length or relative to the width of its parent text, or to be processed automatically.
value :
Length-Sets the relative or absolute distance between the corresponding edge of the element and the edge of the box, valid units are: mm, cm, in, PX, PT, Pica,ex, em ...
Percent-sets the boundary size as a percentage of the width of the parent element.
Auto-automatically, this setting takes the default bounds of the browser.
Example

2, margin

function : The shorthand property that is used to set all the bounds of an element. This is used to describe the distance from 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.
value :
Length-op.
Percent-sets the boundary size as a percentage of the width of the parent element.
Auto-automatically, this setting takes the default bounds of the browser.
Example

Four, Box position properties

1, Height

function : Set the height of the element, the browser adjusts the graph to this height.
value :
Length-mm, CM, px, PT, ...
Auto-Automatic.

2, Width

function : Sets the width of the element, and the browser adjusts the graphic to that width.
value :
Length-mm, CM, in, px, PT, ...
Percent-Sets the graphic size to a percentage of the width of the parent element.
Auto-Auto Adjust

3, float

function : Used to place elements outside the regular element flow layout rules.
value :
None-no changes.
Left-places the contents of other elements on the right side 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 on-line graphics) next to the specified element.
value :
None-Unrestricted.
Left-places the element below the floating element
Right-places the element below the floating element
Both-the element is not allowed to place floating elements on either side







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.