博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
文字超出部分显示点点点
阅读量:7219 次
发布时间:2019-06-29

本文共 592 字,大约阅读时间需要 1 分钟。

hot3.png

文字超出部分显示点点点【CSS3 text-overflow】

 

 

153721_5Qm6_2872176.png

 

 

 

 

 

 

代码:

<!DOCTYPE html>

<html>
<head>
<style> 
div.test
{
white-space:nowrap; 
width:12em; 
overflow:hidden; 
border:1px solid #000000;
}
</style>
</head>
<body>

<p>下面两个 div 包含无法在框中容纳的长文本。正如您所见,文本被修剪了。</p>

<p>这个 div 使用 "text-overflow:ellipsis" :</p>

<div class="test" style="text-overflow:ellipsis;">This is some long text that will not fit in the box</div>

<p>这个 div 使用 "text-overflow:clip":</p>

<div class="test" style="text-overflow:clip;">This is some long text that will not fit in the box</div>

</body>

</html>

转载于:https://my.oschina.net/kaiyuanlong/blog/1647830

你可能感兴趣的文章
【转】 一个fork的面试题
查看>>
20131108
查看>>
django.http.request中HttpRequest对象的一些属性与方法
查看>>
英文对应解释
查看>>
Robotics ToolBox机械臂仿真
查看>>
linux添加环境变量
查看>>
【uva 1312】Cricket Field(算法效率--技巧枚举)
查看>>
VS2017 MVC项目,新建控制器提示未能加载文件或程序集“Dapper.Contrib解决方法
查看>>
【ora-err】ORA-03113: end-of-file on communication channel
查看>>
00.索引-综述
查看>>
strcpy
查看>>
AC3 Rematrix
查看>>
C#之Windows Form Application与attribute
查看>>
函数与指针分析实例
查看>>
爬虫:pycurl模块的使用说明
查看>>
Halcon算子翻译——try
查看>>
Win732位安装PostgreSQL9
查看>>
Ext JS4学习笔记1——环境的搭建
查看>>
.net MVC3实现不同的角色用不同的登录页面
查看>>
Scala学习笔记-12
查看>>