午夜剧场伦理_日本一道高清_国产又黄又硬_91黄色网战_女同久久另类69精品国产_妹妹的朋友在线

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

javascript - 關(guān)于使用overflow: hidden來(lái)清除浮動(dòng)的疑問(wèn)

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

問(wèn)題描述

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

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

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

問(wèn)題解答

回答1:

這是因?yàn)椴](méi)有產(chǎn)生新的 BFC

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

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).

為什么對(duì) <body> 設(shè)置 overflow 會(huì)擴(kuò)散到 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)文章:
主站蜘蛛池模板: 狠狠久久综合 | 日本黄色录像 | 亚洲专区一区 | 国产视频aaa | 午夜家庭影院 | 一级成人免费视频 | 天天综合网天天综合 | 超碰资源在线 | 久久久久久久久久久久久久av | 激情五月综合 | 欧美综合第一页 | 中文字幕乱码一区二区 | 久久精品国产99精品国产亚洲性色 | 久热99| 成人欧美一区二区三区在线观看 | 色综合天天综合 | 日本亚洲欧美 | 日韩国产一区二区 | 国产精选久久 | 日本在线看片 | 久久综合久| 一区二区视频网站 | 日韩欧美亚洲视频 | 黄色免费一级 | 久久撸视频| 97久久国产 | 男人天堂网av | 久草a在线| 一级二级在线观看 | 亚洲综合日韩 | 欧美一级三级 | 蜜桃在线一区二区 | 日本视频在线免费 | 国产一区在线视频观看 | 黄色一二三区 | 青草91 | 欧洲一级视频 | 黄色片亚洲 | 亚洲国产成人久久 | 色蜜桃av | 国产成人97精品免费看片 |