margin:5px 0;平均边距:5px 0 0 0;或margin:5px 0 5px 0 ;?
margin:5px 0 0;平均边距:5px 0 0 0 ;?
同样的填充当然。
此外,它是否在所有浏览器(包括IE6)一致?
解决方法
根据
Box Model:
- If there is only one value,it applies
to all sides.- If there are two values,
the top and bottom margins are set to
the first value and the right and left
margins are set to the second.- If
there are three values,the top is set
to the first value,the left and right
are set to the second,and the bottom
is set to the third.- If there are four
values,they apply to the top,right,
bottom,and left,respectively.
body { margin: 2em } /* all margins set to 2em */ body { margin: 1em 2em } /* top & bottom = 1em,right & left = 2em */ body { margin: 1em 2em 3em } /* top=1em,right=2em,bottom=3em,left=2em */
这是由CSS标准定义的,因此它应该在所有正确实现CSS的浏览器中一致。对于浏览器兼容性,检查blooberry的CSS Support History和quirksmode.根据blooberry,margin是第一次在IE3中实现,因此IE6应该是罚款。