【发布时间】:2016-03-26 04:31:06
【问题描述】:
我有一个名为 bar 的 CSS 类。示例中的我的标签(跨度)是“非常不满意”。如果宽度百分比较低(即:5%),则标签换行符(例如:非常 [linebreak] 不满意)而不是跨越 bar18.png 图形之外的整个 div。
CSS:
.bar {
background: transparent url(bar18.png) repeat-x top left;
float: left;
clear: left;
height: 30px;
}
.bar span{
font-size: 12px;
font-weight: bold;
color: #000;
float: left;
margin-left: 5px;
margin-top: 7px;
}
HTML:
<div class="bar" style="width:8%;">
<span>Very Dissatisfied</span>
</div>
<div class="p">
<span>(1) 8%</span>
</div>
【问题讨论】: