当前第2页 返回上一页
input实现文字超出省略号功能
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | <style>
*{
margin: 0;
padding: 0;
}
.box{
width: 200px;
padding: 15px;
border: 1px solid #f60;
margin: 50px auto;
}
.form-control{
height: 30px;
line-height: 30px;
padding: 5px 10px;
}
.text-ellipsis{
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
h2{
width: 300px;
margin: 10px auto;
}
</style>
<h2 class = "text-ellipsis" >文字超出宽度自动变成省略号</h2>
<div class = "box" >
<input type= "text" class = "form-control text-ellipsis" >
</div>
|
其实,让input实现文字超出自动变省略号也非常简单,还是那三段代码。经测试,目前(2018-11-23)为止,只有最新的Chrome、Firefox两个浏览器支持,移动端未测试!
以上就是input实现文字超出省略号(代码示例)的详细内容,更多文章请关注木庄网络博客!
返回前面的内容
相关阅读 >>
详解html5应用中accordion三种效果的探索
css @keyframes规则怎么用
css中文字的颜色怎么设置
css布局之盒子模型属性
html5 websql四种基本操作的介绍
纯css如何实现图片轮播
html5实现拖拽功能步骤详解
css用什么打开
css中设置英文单词之间间距的属性是什么
html5布局之路怎么样
更多相关阅读请进入《ellipsis》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » input实现文字超出省略号(代码示例)