当前位置:网站首页>text-overflow失效
text-overflow失效
2022-06-11 06:23:00 【Saucey_6】
使用场景:用…替换多余的文字
css方法
text-overflow: ellipsis;
overflow:hidden;
white-space: nowrap;
但是在表格中它是不生效的!!!
如果在css方法中添加display:block和固定的宽度就ok!
display: block;
width: 100px;
text-overflow: ellipsis;
overflow:hidden;
white-space: nowrap;
这是为什么呢?
- 单纯的来看,tr,td既是行内元素也是块级元素。
- 因为它们可以设置其宽高,但是不能设置其padding。
- 我们在使用display:block之后相当于将行级元素转化为块级元素,并且为之设置宽度。
- 因为overflow,text-overflow的使用是相对而言对文本或者区域进行截断和隐藏。
边栏推荐
- Jenkins user rights management
- Why is it that the live video of the devices connected to easygbs suddenly cannot be played? Insufficient database read / write
- The artistic director and production designer of Disney's Mandalorian revealed the virtual scene production behind it
- Simple knapsack problem
- 022-Redis数据库0基础入门
- 统计某次操作(函数)耗时时长
- jenkins-不同风格的项目构建
- Using Metasploit Trojan horse for remote control
- Global case | how an airline with a history of 100 years can expand and transform to promote innovation in the aviation industry
- 修复鼠标右键没有vscode快捷入口的问题
猜你喜欢

Global case | how Capgemini connects global product teams through JIRA software and confluence

PHP laravel8 send email

All the benefits of ci/cd, but greener

通过R语言且只用基础package来制作一个小游戏

Record the first data preprocessing process

Topic collection of FIFO minimum depth calculation

Training and testing of super score model in mmediting

Jenkins voucher management

Notes sur les questions d'entrevue de la FPGA (IV) - - détecteur de séquence, Code gris dans le domaine de l'horloge croisée, opération de ping - pong, réduction de la perte statique et dynamique, err

FPGA interview notes (III) -- implementation of handshake signal synchronization in cross clock domain, arbitrary frequency division, binary conversion, RAM memory, original code inversion and complem
随机推荐
jenkins-凭证管理
The difference between call and apply and bind
A piece of code has been refactored six times by the boss, and my mind is broken
Teach everyone how to implement an electronic signature
Sqoop installation tutorial
Using idea to add, delete, modify and query database
break,continue有什么区别和用法?
On the social moral and ethical issues behind short videos (personal point of view, for reference only)
Sharing of personal common software and browser plug-ins
617. 合并二叉树
通过两种方式手写一个消息队列
Compliance management 101: processes, planning and challenges
jenkins-不同风格的项目构建
Convert multiple pictures into one NPY file storage
The classification effect of converting video classification data set to picture classification data set on vgg16
Eureka集群搭建
Metasploitabile2 target learning
Zvuldrill installation and customs clearance tutorial
Chapter 1 of machine learning [series] linear regression model
On cursor in MySQL