CSS3实现单行、多行文本溢出(省略号的形式出现)
2024-09-08 06:48:48
<!DOCTYPE html>
<html> <head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
p {
width: 100px;
height: 40px;
line-height: 40px;
text-align: center;
margin: 0 auto;
background: #ccc;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} div {
display: block;
display: -webkit-box;
max-width: 300px;
height: 109.2px;
margin: 10px auto;
font-size: 26px;
line-height: 1.4;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
</head>
<body>
<p>文本溢出文本溢出文本溢出文本溢出文本溢出文本溢出文本溢出文本溢出文本溢出文本溢出文本溢出</p>
<div>文本溢出文本溢出文本溢出文本溢出文本溢出文本溢出文本溢出文本溢出文本溢出文本溢出文本溢出</div>
</body> </html>
最新文章
- 【转】Caffe初试(九)solver及其设置
- python基础之初始python
- 最全的jQuery知识汇总
- Apache Spark技术实战之5 -- SparkR的安装及使用
- JQuery文本框水印插件的简单实现
- 【IOS笔记】Windows
- Segmentation
- run loop 输入源
- 【CSS】css各种居中方法
- WebAPI返回JSON的正确格式
- 一款很不错的html转xml工具-Html Agility Pack
- COJ 0650 绝世难题(一) 可爱的仙人掌
- LeetCode OJ 222. Count Complete Tree Nodes
- Mac环境下使用VSCode搭建Go开发环境
- GTID做mysql主从时报错
- Spring整合ActiveMq消息队列
- Bootstrap -- 文件上传插件File Input的使用
- 提高Android Studio的Build速度实践
- Win7 安装配置 nexus3.7.1
- 神经网络中的Softmax激活函数
热门文章
- BZOJ_3295_[Cqoi2011]动态逆序对_CDQ分治+树状数组
- A - Mike and Fax
- c语言sscanf总结
- 用";\v";==";v";判断是IE浏览器和非IE
- [转]C# Socket编程笔记
- Android—— ListView 的简单用法及定制ListView界面
- poj3069【贪心,水】
- POJ1861 kruskal.
- python 类装饰器
- bzoj 3109: [cqoi2013]新数独【dfs】