第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定

清除浮動的提問

為元素為什么display:table呢? 不能使block

正在回答

1 回答

涉及到margin折疊。

W3C:http://www.w3.org/TR/CSS2/tables.html#anonymous-boxes

Any table element will automatically generate necessary anonymous table objects around itself, consisting of at least three nested objects corresponding to a 'table'/'inline-table' element, a 'table-row' element, and a 'table-cell' element.

所以display:table 會產(chǎn)生匿名的table-cell元素,進(jìn)而產(chǎn)生BFC從而避免margin折疊。

It does not need to be display: table. The difference, however, is worth to be mentioned: If you use display: block instead of display: table, your margins will collapse as usual. If you use display: table, however, you will lose margin collapse between siblings and the first/last children of the element where you've applied the clearfix on, which might or might not be a desired feature.

代碼演示

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消
CSS深入理解之overflow
  • 參與學(xué)習(xí)       41723    人
  • 解答問題       85    個

深入理解overflow相關(guān)特性及實(shí)際應(yīng)用,為你打開另外一扇學(xué)習(xí)之窗

進(jìn)入課程

清除浮動的提問

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號