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