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

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

為什么清除浮動(dòng)要設(shè)置成width:100%呢?

為什么清除浮動(dòng)要設(shè)置成width:100%呢?

正在回答

3 回答

我的理解:設(shè)定了over:hidden;后,浮動(dòng)的塊不重疊了,而是相鄰的關(guān)系,又因?yàn)閣idth=100%,所以它需要的寬度是整個(gè)一行,所以只能夠靠換行來(lái)實(shí)現(xiàn),這相當(dāng)于清除浮動(dòng)。

也不知道理解的對(duì)不對(duì)呢。

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

qq_伊藤_03776080 提問(wèn)者

哦~這樣理解好像有點(diǎn)懂了,謝謝大神
2016-10-26 回復(fù) 有任何疑惑可以回復(fù)我~

重發(fā)一遍。

? 1.<p>設(shè)置overflow:hidden觸發(fā)BFC。

“Floats, absolutely positioned elements, block containers (such as inline-blocks, table-cells, and table-captions) that are not block boxes, and block boxes with 'overflow' other than 'visible' (except when that value has been propagated to the viewport) establish new block formatting contexts for their contents.

? ?2.p作為block container box,其中的內(nèi)容與不在一個(gè)BFC的float元素是互不影響的。按理說(shuō),這樣就已經(jīng)能夠保證p中inline-level的內(nèi)容不受float元素的影響了

? The border box of a table, a block-level replaced element, or an element in the normal flow that establishes a new block formatting context (such as an element with 'overflow' other than 'visible') must not overlap the margin box of any floats in the same block formatting context as the element itself. If necessary, implementations should clear the said element by placing it below any preceding floats, but may place it adjacent to such floats if there is sufficient space. They may even make the border box of said element narrower than defined by section?10.3.3.CSS2 does not define when a UA may put said element next to the float or by how much said element may become narrower.?

? 3.最后p加入width:100%(注意,這里100%是相對(duì)父元素的寬度的計(jì)算值Calculated value)只不過(guò)是為了形成“換行”而已

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? --https://www.w3.org/TR/CSS21/visuren.html#img-inline-layout

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

qq_伊藤_03776080 提問(wèn)者

謝謝啦
2016-10-29 回復(fù) 有任何疑惑可以回復(fù)我~

“Floats, absolutely positioned elements, block containers (such as inline-blocks, table-cells, and table-captions) that are not block boxes, and block boxes with 'overflow' other than 'visible' (except when that value has been propagated to the viewport) establish new block formatting contexts for their contents.”

? ?2.p作為block container box,其中的內(nèi)容與不在一個(gè)BFC的float元素是互不影響的。按理說(shuō),這樣就已經(jīng)能夠保證p中inline-level的內(nèi)容不受float元素的影響了

The border box of a table, a block-level replaced element, or an element in the normal flow that establishes a new block formatting context (such as an element with 'overflow' other than 'visible') must not overlap the margin box of any floats in the same block formatting context as the element itself. If necessary, implementations should clear the said element by placing it below any preceding floats, but may place it adjacent to such floats if there is sufficient space. They may even make the border box of said element narrower than defined by section?10.3.3.CSS2 does not define when a UA may put said element next to the float or by how much said element may become narrower.?

? 3.最后p加入width:100%(注意,這里100%是相對(duì)父元素的寬度的計(jì)算值Calculated value)只不過(guò)是為了形成“換行”而已

????????????????????????????????????????????????????????????????--https://www.w3.org/TR/CSS21/visuren.html#img-inline-layout

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

舉報(bào)

0/150
提交
取消
網(wǎng)頁(yè)布局基礎(chǔ)
  • 參與學(xué)習(xí)       214674    人
  • 解答問(wèn)題       1833    個(gè)

讓你精通CSS中三大定位機(jī)制,徹底掌握網(wǎng)頁(yè)布局的相關(guān)知識(shí)

進(jìn)入課程

為什么清除浮動(dòng)要設(shè)置成width:100%呢?

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

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

幫助反饋 APP下載

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

公眾號(hào)

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