margin-bottom:30px;
div{
? ? width:300px;
? ? height:300px;
border:1px solid red;
margin-bottom:35px;}
這樣寫也是一樣的效果啊,加#box1{margin-bottom:30px;}是為了以后寫其它盒子的時候方便改margin嗎?
div{
? ? width:300px;
? ? height:300px;
border:1px solid red;
margin-bottom:35px;}
這樣寫也是一樣的效果啊,加#box1{margin-bottom:30px;}是為了以后寫其它盒子的時候方便改margin嗎?
2018-10-03
舉報
2018-10-25
沒錯,而且#表示id權值較高,除非用!Important,不然其他地方的修改不會改變box1的margin-bottom。將box1獨立出來在某些情況下非常有用
2018-10-04
加#box1{margin-bottom:30px;}是只針對box1生效,對box2的外部底邊距不影響