亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

您的位置:首頁技術(shù)文章
文章詳情頁

javascript - 關(guān)于使用overflow: hidden來清除浮動的疑問

瀏覽:88日期:2022-12-21 13:48:30

問題描述

正常情況下,給浮動的父元素設(shè)置overflow:hidden;就可以清楚浮動,但是我發(fā)現(xiàn)被浮動元素的父元素是body時,給body設(shè)置overflow:hidden,是無法清除浮動的,有人說是body不屬于普通流,所以無效,有誰能解釋下嗎?

感謝:CRIMX借用王大陸的一句話:

你這種人不是大神,就是走在成為大神的路上。

問題解答

回答1:

這是因為并沒有產(chǎn)生新的 BFC

產(chǎn)生新 BFC 的一個條件:

Block-level, non-replaced elements in normal flow when ’overflow’ does not compute to ’visible’ (except if the ’overflow’ property’s value has been propagated to the viewport).

為什么對 <body> 設(shè)置 overflow 會擴散到 viewport:

UAs must apply the ’overflow’ property set on the root element to the viewport. When the root element is an HTML 'HTML' element or an XHTML 'html' element, and that element has an HTML 'BODY' element or an XHTML 'body' element as a child, user agents must instead apply the ’overflow’ property from the first such child element to the viewport, if the value on the root element is ’visible’. The ’visible’ value when used for the viewport must be interpreted as ’auto’. The element from which the value is propagated must have a used value for ’overflow’ of ’visible’.

標(biāo)簽: JavaScript
相關(guān)文章:
主站蜘蛛池模板: 91网视频在线观看 | 精品在线91 | 国产精品青草久久久久婷婷 | 最新国产中文字幕 | 青娱乐成人 | 黄a级免费 | 国产香蕉视频 | 91视频在 | 国产成人午夜视频 | 欧美成人看片一区二区三区 | 黄色网址在线免费观看 | 精品国产亚一区二区三区 | 欧美高清一级毛片免费视 | 被黑人做的白浆直流在线播放 | 伊人久久久久久久久香港 | 日本免费看片在线播放 | 久久91亚洲人成电影网站 | 日韩视频一区 | 国产香蕉久久 | 美女喷水视频在线观看 | 幸福宝色多多 | 欧美日韩亚洲国产综合 | 中文字幕亚洲无线码 | 亚洲欧美精品综合中文字幕 | 国产在线自在拍91精品黑人 | 久久精品呦女 | 一次性a爱片 | 欧美亚洲性色影视在线 | 国产剧情一区二区 | 精品免费在线 | 91免费国产| 黄色 在线| 一级片在线免费观看 | 国产免费看片 | 午夜淫片 | 国产免费黄色网址 | 国产精品福利午夜在线观看 | 欧美精品在线视频 | 黄色一级网址 | 久久精品视频免费看 | 国产福利在线观看永久免费 |