CSS syntax manual four text filling, border, border and location attribute 2
Source: Internet
Author: User
3. Box boundary attributes
1. margin-bottom
Margin-left
Margin-right
Margin-top
Function: These four attributes are used to set the distance between an element and its adjacent elements. They can be defined by length or the percentage of width relative to the parent text, or automatically processed.
Value:
Length-set the relative or absolute distance between the corresponding edge of the element and the edge of the box. Valid units: mm, cm, in, px, pt, pica, ex, em...
%-Set the boundary size as the percentage of the parent element width.
Auto-auto. This setting takes the default border of the browser.
Example
2. margin
Function: short for all boundaries of elements. This is used to describe the distance from the edge of the element content to the edge of the box. This area is always transparent and you can see the background of the following page.
Value:
Length-same as before
%-Set the boundary size as the percentage of the parent element width.
Auto-auto. This setting takes the default border of the browser.
Example
IV. Box position attributes
1. height
Function: sets the element height. The browser adjusts the image based on the height.
Value:
Length-mm, cm, px, pt ,.....
Auto-auto.
2. width
Function: sets the element width. The browser adjusts the image based on the width.
Value:
Length:-mm, cm, in, px, pt ,......
Percent-set the graph size to the percentage of the width of the parent element.
Auto-automatic adjustment
3. float
Function: This function is used to place elements outside of the general element stream layout rules.
Value:
None-no changes.
Left-place the content of other elements to the right of the floating element.
Right-place the content of other elements to the left of the floating element.
4. clear
Function: allows or disables other elements (usually online images) next to a specified element ).
Value:
None-unrestricted.
Left-place the element below the floating element on the left
Right-place the element under the floating element on the right
Both-float elements cannot be placed on both sides
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