div框中文字过多省略号显示css方法
程序员文章站
2022-03-02 18:13:01
...
<style type="text/css">
.div {width:100px;height:50px;background:#ebebeb;;text-align:center;font-family:"Microsoft YaHei";line-height:50px;color:#333;font-size:18px;position:relative;top:-1px;filter:alpha(opacity=50);
-moz-opacity:0.7;
-khtml-opacity: 0.7;
opacity: 0.7;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap; }
</style>
<div class="div"></div>
.div {width:100px;height:50px;background:#ebebeb;;text-align:center;font-family:"Microsoft YaHei";line-height:50px;color:#333;font-size:18px;position:relative;top:-1px;filter:alpha(opacity=50);
-moz-opacity:0.7;
-khtml-opacity: 0.7;
opacity: 0.7;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap; }
</style>
<div class="div"></div>