input实现文字超出省略号(代码示例)


当前第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》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...