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

标签 css jquery-mobile css-float

在下面的 html 设计中,我想将文本溢出应用于媒体播放和备注标签的省略号,并希望媒体播放(第一大行)在第一行和备注(第二行)上在下一行。 Play and Stop 和 media-played and remarks 应该都在同一行。你能帮帮我吗?

.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/

关于css - 标签文本溢出时应用省略号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18083612/

相关文章:

html - 不同的背景 repeat-x 左右

javascript - Webpack - 对 scss 文件使用 CopyWebpackPlugin

jquery - Swiper 在 Jquery Mobile 中不工作

java - Phonegap(安卓): Connecting and Printing to Bixolon BR200

html - 内容不会与向左浮动的 div 的标题标签左对齐

javascript - 在悬停状态下突出显示多个元素

CSS:带有边界半径的边框质量很差

ruby-on-rails - Rails 3.2 和 phonegap

html - 为什么我的 div 没有向左浮动?

css - 试图垂直对齐容器 div 中的两个 float div