This article explains in detail the use of css outer margin
h2{margin:10px 0;} p{margin:20px 0;} ......<h2>这是一个标题</h2><p> <h2>这是又一个标题</h2></p>本例中,第一个h2的margin-bottom(10px),p的margin-top(20px),第二个h2的margin-top(10px)将被合并,它们之间的margin间隙最后是(20px),即取三者之间最大的那个值。
margin: [
##Default value: see Each independent attribute
applies to : all elements except table class elements of table | inline-table | table-caption
InheritanceSex: None
AnimationSex:Yes
Calculated value: Look at each independent attribute
Related attributes: [ margin-top ] || [ margin-right ] || [ margin-bottom ] || [ margin-left]
Value:for calculation. In other cases, refer to height, which can be negative
h2{margin:10px 0;} p{margin:20px 0;} ......<h2>这是一个标题</h2><p> <h2>这是又一个标题</h2></p>本例中,第一个h2的margin-bottom(10px),p的margin-top(20px),第二个h2的margin-top(10px)将被合并,它们之间的margin间隙最后是(20px),即取三者之间最大的那个值。
The above is the detailed content of Detailed explanation of the use of CSS external margins. For more information, please follow other related articles on the PHP Chinese website!