微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

css – 标签文本溢出时应用省略号

在下面的html设计中,我想将文本溢出应用于省略号用于媒体播放和备注标签,并希望第一行播放媒体(第一个大行)和备注(第二个bing行)将继续下一个线. Play和Stop以及媒体播放和备注都应该属于同一行.你能帮帮我吗?
.oneline {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: Nowrap;
}

#player-play,#player-stop
{
   display: inline-block;
   width: 48px;
   height: 48px;
}
#player-play
{
    background-image: url('../images/play.png');
}
#player-stop
{
   background-image: url('../images/stop.png');
}


 <div  id="player" data-role="header">
        <div data-role="navbar">
            <ul>
                <li class="oneline">
                    <a href="#" id="player-play" title="Play / Pause" style="float:left" ></a>
                    <a href="#" id="player-stop" title="Stop" style="float:left" ></a>
                    <label id="media-played" class="oneline">first big line first bing line first bing line first big line</label>
                    <label id="remarks">second big line second big line second big line second big line</label>
                </li>
            </ul>
        </div>
            <div data-role="navbar">
                <ul>
                    <li>
                        <input type="range" id="time-slider" data-highlight="true" step=".1" data-mini="true" min="0" max="5.40" value="3.4" disabled>
                    </li>
                </ul>
        </div>
    </div>

解决方法

新CSS:
#media-played,#remarks {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: Nowrap;
    display:block;
}

#player-play,#player-stop
{
   display: inline-block;
   width: 48px;
   height: 48px;
}
#player-play
{
    background-image: url('../images/play.png');
}
#player-stop
{
   background-image: url('../images/stop.png');
}

的jsfiddlehttp://jsfiddle.net/dTffH/

原文地址:https://www.jb51.cc/css/217468.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。