当标签文本溢出时应用省略号 [英] apply ellipsis when label text is overflow

查看:146
本文介绍了当标签文本溢出时应用省略号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在下面的html设计中,我想对媒体播放和备注标签应用文本溢出到省略号,并希望第一行的媒体播放(第一大行)和第二行的备注(第二行)在下一行。播放和停止和媒体播放和备注应该都在同一行。你能帮我吗?

In this below html design, I want to apply text-overflow to ellipsis for the media-played and remarks label and want the media-played (first big line) on the first line and remarks (second bing line) would go on the next line. The Play and Stop and media-played and remarks should all fall in the same row. Can you please help me out?

.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');
}

jsFiddle: http://jsfiddle.net/dTffH/

jsFiddle:http://jsfiddle.net/dTffH/

这篇关于当标签文本溢出时应用省略号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆