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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

清除浮動(dòng)的提問

為元素為什么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 會(huì)產(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ù)我~

舉報(bào)

0/150
提交
取消

清除浮動(dòng)的提問

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

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

幫助反饋 APP下載

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

公眾號(hào)

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