引导内联列表大量的文本
Bootstrap Inline list large amount of text
我知道Bootstrap有一个内置的类'list-inline'。在我添加大量文本之前,它工作得很好,然后我得到以下内容:
http://postimg.org/image/4ygjowp43/我想粉红色的div不包装下面的绿色div。我已经尝试了另一个帖子stackoverflow:如何在一个行内块与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;
}
小提琴:
好吧,根据你的要求,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;
}
请尝试以下
HTML <ul class="remove-bullet-list hanging">
<li>
<div class="col-sm-2 description">
<b>Description: </b>
</div>
<div class="col-sm-6 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.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;
padding:0px;
}
.description-text {
background-color: pink;
padding:0px;
}
http://www.bootply.com/yCWWBE0mCM 我已经稍微修改了你的CSS。您可以看到这适用于所有浏览器。演示看到。
.description {
background-color: green;
float: left;
}
.description-text {
background-color: pink;
padding-left: 14px;
overflow: hidden;
display:table-cell;
vertical-align:top; /* vertically align top work with display:table-cell*/
}
li{overflow: hidden;display:table;}
注意:这里是另一个演示链接,也工作得很好,但它在IE浏览器失败,这就是为什么我提供了另一个解决方案。
相关文章:
- 将输入字段中的文本提交到我的数据库,同时将其添加到我的列表中
- 如何在从多选下拉列表中选择选项值时动态生成文本框
- ng在下拉列表和文本区域提交
- 如何在剑道下拉列表中按文本和值搜索
- 如何在ReactJs中链接下拉列表和文本区域
- 使用 jQuery 从下拉列表中获取所选文本
- 根据用户从下拉列表中的选择显示多个文本框
- 如何在jquery中获取列表项的最顶端父项的文本
- 如何在下拉列表更改时自动填充mysql查询结果中的文本框值
- 如何按骨干.js打印“此”列表项的文本
- 从文本文件js中读取列表
- 使用两个下拉列表的值填充文本框
- 如果没有从下拉列表中选择任何值,则允许使用php、mysql、javascript将文本框添加到mysql表中
- 将文本框/单选按钮/和下拉列表中的信息添加到dataTable
- Meteor:从Twilio获取SMS文本列表,并将它们插入mongoDB
- 将URL的文本列表转换为可点击的HTML链接
- 生成重新格式化的文本列表
- 为什么ava在比较对象列表和对象文本列表时失败
- 如何在用户在文本列表中键入单词时突出显示JSON字典中的单词,并在表单提交时用它们的描述替换它们
- 更改图像链接悬停在文本列表