Sto*_*m3y 5 html css text overflow ellipsis
我正在尝试在我的网站上运行省略号.这是以下HTML/CSS代码,它似乎不起作用.
CSS:
.oneline {
text-overflow:ellipsis;
white-space: nowrap;
width: 50px;
overflow: hidden;
}
Run Code Online (Sandbox Code Playgroud)
HTML:
<div class="oneline">Testing 123 Testing 456 Testing 789</div>
Run Code Online (Sandbox Code Playgroud)
Ali*_*guy 10
基于最初的帖子,我们都假设显而易见,但以防万一...;)
<style type="text/css">
.oneline {
text-overflow : ellipsis;
white-space : nowrap;
width : 50px;
overflow : hidden;
}
</style>
<div class="oneline">Testing 123 Testing 456 Testing 789</div>
Run Code Online (Sandbox Code Playgroud)
编辑:解决方案是设置段落与div的样式.