【问题标题】:label linebreaking - should span across entire div标签换行 - 应该跨越整个 div
【发布时间】: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>

【问题讨论】:

    标签: html css


    【解决方案1】:

    请试试这个:

    span{margin-left:20%}
    .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;
    white-space: nowrap;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-15
      • 2020-11-02
      • 1970-01-01
      • 2013-03-22
      相关资源
      最近更新 更多