gpt4 book ai didi

html - CSS 格式/溢出问题

转载 作者:行者123 更新时间:2023-11-28 19:04:34 25 4
gpt4 key购买 nike

HTML:

<div id="browse_list">
<div class="browse_list_element">
<span class="list_element_logo">
Ghre
</span>
<span class="list_element_name">
Ghre
</span>
<span class="list_element_info">
Ghre
</span>
<span class="list_element_rating">
Ghre
</span>
</div>
<div class="browse_list_element">
<span class="list_element_logo">
Thre
</span>
<span class="list_element_name">
Thre
</span>
<span class="list_element_info">
Thre
</span>
<span class="list_element_rating">
Thre
</span>
</div>
</div>

CSS:

#browse_list, .browse_list_element
{
overflow: auto;
border-style: solid;
width: 400px;
}
.list_element_logo
{
width: 100px;
position: absolute;
left: 0px;
}
.list_element_name
{
width: 100px;
position: absolute;
left: 100px;
}
.list_element_info
{
min-width: 150px;
max-width: 100px;
position: absolute;
left: 200px;
}
.list_element_rating
{
width: 50px;
position: absolute;
left: 350px;
}

http://jsfiddle.net/F6xJ2/

我该如何解决这个问题?我想让父级 (.browse_list_element) 取 children 的高度。

最佳答案

这就是你想要的吗?

http://jsfiddle.net/Kyle_Sevenoaks/Yt6Yk/

HTML:(相同)

<div id="browse_list">
<div class="browse_list_element">
<span class="list_element_logo">
Ghre
</span>
<span class="list_element_name">
Ghre
</span>
<span class="list_element_info">
Ghre
</span>
<span class="list_element_rating">
Ghre
</span>
</div>
<div class="browse_list_element">
<span class="list_element_logo">
Thre
</span>
<span class="list_element_name">
Thre
</span>
<span class="list_element_info">
Thre
</span>
<span class="list_element_rating">
Thre
</span>
</div>
</div>

CSS:

#browse_list, .browse_list_element
{
overflow: auto;
border-style: solid;
width: 400px;
}
.browse_list_element span
{
display: inline-block;
}

/*.list_element_logo /*commented out, for now
{
width: 100px;
position: absolute;
left: 0px;
}
.list_element_name
{
width: 100px;
position: absolute;
left: 100px;
}
.list_element_info
{
min-width: 150px;
max-width: 100px;
position: absolute;
left: 200px;
}
.list_element_rating
{
width: 50px;
position: absolute;
left: 350px;
}*/

关于html - CSS 格式/溢出问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4143312/

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