The best CSS margin-top property Tutorial In 2024, In this tutorial you can learn Examples,Attribute definitions and instructions,Browser Support,Property Value,related articles,
Setting a p element upper margins:
margin-top property is set to an upper element margins.
Note: negative values are allowed.
Defaults: | 0 |
---|---|
inherit: | no |
version: | CSS1 |
JavaScript syntax: | object .style.marginTop = "10px" |
Figures in the table represent the first browser to support the version number of the property.
属性 | |||||
---|---|---|---|---|---|
margin-top | 1.0 | 6.0 | 1.0 | 1.0 | 3.5 |
value | description |
---|---|
auto | On the outside from the browser settings. |
length | It defines a fixed upper margin. The default value is 0. |
% | Definition is based on a percentage of the total height of the parent object margins. |
inherit | Provisions should be inherited from the parent element of the margin. |
CSS tutorial: CSS Margin