当前位置:网站首页>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的使用是相对而言对文本或者区域进行截断和隐藏。
边栏推荐
- [must see for game development] 3-step configuration p4ignore + wonderful Q & A analysis (reprinted from user articles)
- A collection of problems on improving working frequency and reducing power consumption in FPGA design
- CCS method of installing compiler
- Sqli-libs range 23-24 filtration and secondary injection practice
- Build the first power cloud platform
- Chapter 4 of machine learning [series] naive Bayesian model
- Zvuldrill installation and customs clearance tutorial
- Which company is better in JIRA organizational structure management?
- Sharing of personal common software and browser plug-ins
- Chapter 2 of machine learning [series] logistic regression model
猜你喜欢

Simple understanding of pseudo elements before and after

Sqli-libs range 23-24 filtration and secondary injection practice

Servlet

Autojs, read one line, delete one line, and stop scripts other than your own

Differences between FindIndex and indexof

FPGA面试题目笔记(三)——跨时钟域中握手信号同步的实现、任意分频、进制转换、RAM存储器等、原码反码和补码

Servlet

Eureka集群搭建

FPGA面试题目笔记(一)——FPGA开发流程、亚稳态和竞争冒险、建立保持时间、异步FIFO深度等

Eureka cluster setup
随机推荐
Chapter 1 of machine learning [series] linear regression model
Growth Diary 01
个人常用软件及浏览器插件分享
CCS安装编译器的方法
Learn a trick to use MySQL functions to realize data desensitization
Eureka集群搭建
Error reporting injection of SQL injection
617. 合并二叉树
Communication between different VLANs
Examinelistactivity of Shandong University project training
[must see for game development] 3-step configuration p4ignore + wonderful Q & A analysis (reprinted from user articles)
Vulnhub's breach1.0 range exercise
Vulhub 8.1-backdoor vulnerability recurrence
All the benefits of ci/cd, but greener
Fix the problem that the right mouse button does not have a vscode shortcut
A multi classification model suitable for discrete value classification -- softmax regression
Zvuldrill installation and customs clearance tutorial
FPGA设计——乒乓操作实现与modelsim仿真
2021-03-25
Handwriting promise [03] - realize multiple calls and chain calls of then method