gpt4 book ai didi

html - 'height: 0;' 在 CSS 中是什么意思?

转载 作者:太空宇宙 更新时间:2023-11-04 14:14:03 27 4
gpt4 key购买 nike

我正在使用一些旧的 CSS 代码。在许多地方,他们将高度声明为 height: 0;0 是什么意思,它是什么单位?

谁能帮帮我。

最佳答案

css中,height表示元素的物理高度。

它与height:0pxheight:0% 相同。

假设以下 html 元素,一个具有属性 height:0;,另一个具有属性 height:100px 让我们看看会发生什么

#me {
height: 0;
background-color: #333;
}
#me2 {
height: 100px;
background-color: #333;
color: white;
}
<div id="me" style="">this is an element</div>
<br/>
<div id="me2" style="">this is an element</div>

关于html - 'height: 0;' 在 CSS 中是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32564803/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com