English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
margin-The bottom CSS property sets the bottom margin of the element. However, in many cases, likemarginSuch shorthand CSS properties are more convenient and preferable to use.
The following table provides usage instructions and version history of this property, as well as its usage syntax in JavaScript scripts.
Default value: | 0 |
---|---|
Applies to: | All elements, but not table displayelements of types other than table-caption table inline-table. It also applies to ::first-letter. |
Inheritance: | No |
Animatable: | Yes.Please refer to Animation properties. |
Version: | CSS 1,2,3 |
JavaScript syntax: | object.style.marginBottom="20px" |
The syntax of this property is as follows:
margin-bottom: length | percentage | auto | initial | inherit
The following examples demonstrate how to use margin-bottom property.
h1 { margin-bottom: 25px; } p { margin-bottom: 50px; }Test and see‹/›
The following table describes the value of this property.
Value | Description |
---|---|
length | Specify the bottom outer margin value with specific units, such as px, pt, cm, em, etc., which can be negative. |
percentage | Specify the bottom outer margin based on a percentage of the parent element's width. |
auto | The browser will calculate the margin of the specified element. |
initial | Set this property to its default value. |
inherit | If specified, the associated elements will use the margin of their parent element-The value of the bottom property. |
margin-Browser compatibility of the bottom property, the numbers in the table below represent the minimum version number of browsers that support this property; all mainstream browsers support this property.
|
Please refer to the following tutorials:CSS Margin,CSS Box Model.
Related properties:margin,margin-left,margin-right,margin-top.