在Web浏览器的上下文中,“渲染树”仅包含在网页上可见的元素。因此带有的元素display: none
不会进入渲染树。但我知道,渲染树中包含带有height: 0
和的元素position : absolute; left: 100%
,即使在渲染时它们不会在网页上可见。那么,为什么这些元素仍包含在渲染树中?
.no-height {
height: 0;
};
.absolute {
position: absolute;
}
<div class="no-height">
<p class="absolute">still here</p>
</div>
.no-height {
height: 0;
border: 5px solid;
margin: 120px;
};
<div class="no-height">
</div>
I should be at top
.no-height {
height: 0;
};
<div>
some inline<div class="no-height"></div>text
</div>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句