gpt4 book ai didi

javascript - Bootstrap 内联列表大量文本

转载 作者:太空宇宙 更新时间:2023-11-04 13:01:22 24 4
gpt4 key购买 nike

我知道 Bootstrap 有一个内置类“list-inline”。在我添加大量文本之前效果很好,然后我得到以下内容:

http://postimg.org/image/4ygjowp43/

我希望粉红色的 div 不包裹在绿色的 div 之下。我试过关于 stackoverflow 的另一篇文章:How to wrap lines in an inline-block with CSS?而且我无法让花车工作。

这是我的 HTML:

        <ul class="remove-bullet-list hanging">
<li>
<div class="description">
<b>Description: </b>
</div>
<div class="description-text">
Large amount of text. Large amount of text. Large amount of text. Large amount of text. Large amount of text. Large amount of text. Large amount of text. Large amount of text. Large amount of text. Large amount of text.
</div>
</li>
</ul>

这是我的 CSS:

.description {
background-color: green;
overflow: hidden;
float: left;
}

.description-text {
background-color: pink;
padding-left: 14px;
}

最佳答案

Fiddle:

好吧,根据您的要求,display:table 效果最好。

你的风格将是,

.description-text {
background-color: pink;
display: table-cell;
padding-left: 14px;
width: 100%;
}
.description {
background-color: green;
overflow: hidden;
}
.remove-bullet-list li {
display: table;
}

关于javascript - Bootstrap 内联列表大量文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25439620/

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