text-overflow 文字超出
1. 官网定义
text-overflow 属性规定当文本溢出包含元素时发生的事情。
2. 解释
3. 语法
.demo{
text-overflow: clip|ellipsis|string;
}
属性值说明
4. 兼容
IE | Edge | Firefox | Chrome | Safari | Opera | ios | android |
---|---|---|---|---|---|---|---|
all | all | all | all | all | all | all | all |
5. 实例
<div class="demo">
网css3属性教学 text-overflow。
</div>
.demo{
height: px;
width: px;
overflow: hidden;
white-space: Nowrap;
text-overflow:clip ;
}
效果图
- 文字超出元素后使用省略号。
<div class="demo">
网css3属性教学 text-overflow。
</div>
.demo{
height: px;
width: px;
overflow: hidden;
white-space: Nowrap;
text-overflow:ellipsis ;
}
效果图
- 文字超出后使用
!
。
<div class="demo">
网css3属性教学 text-overflow。
</div>
.demo{
height: px;
width: px;
overflow: hidden;
white-space: Nowrap;
text-overflow:"!" ;
}
效果图
说明:只在火狐浏览器兼容。