firefox中text-overflow:ellipsis的问题
来源:互联网 发布:天猫 淘宝商城秒杀 编辑:程序博客网 时间:2024/05/17 18:02
【2016年5月26日 easyui css】
各浏览器现象(自动截断而非直接...):
基于上述现象,所以引起此次现象的原因有可能是不同浏览器对easyui treegrid的不同支持和渲染,这个有待进一步排查和思考。持续更新以记录之。
在使用easyui treegrid进行数据加载的过程中,当字段的宽度过小,字段名称过长时在不同浏览器的显示行为不一样,具体如下:
chrome: IE / firefox:
css中有专门的属性来实现文字过长时出现文字+...的情况,firefox早期的版本不太支持,但是最新版44之后都支持,给父类设置如下的样式,当长度超过时会出现我们要求的效果:
width: 200px; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;项目中出现如上chrome和firefox的样式都不是我们想要的,用webDeveloper查看当前样式,父类的样式符合上述规范,但是子类的span被设置了display:inline-block;属性,所以上述对于文字的css样式设定不起作用,还原为行内元素即可。即下面改为display:inline即可。
修改之后的效果图如下:
但是再深入思考,发现在firefox中使用上述规则后效果为隐藏,而不是直接出现...<!DOCTYPE html><html><head lang="en"> <meta charset="UTF-8"> <title>text-overflow示例</title> <style> #test{ width: 200px; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap: normal;border:1px solid red; }.span01{} </style></head><body> <div id="test"><span class="span01">this is a long lo ng story,this aidj kjdisnnnnnnnnn<span></div></body></html>
各浏览器现象(自动截断而非直接...):
基于上述现象,所以引起此次现象的原因有可能是不同浏览器对easyui treegrid的不同支持和渲染,这个有待进一步排查和思考。持续更新以记录之。
0 0
- firefox中text-overflow:ellipsis的问题
- Firefox实现text-overflow:ellipsis
- 解决Firefox浏览器不支持text-overflow:ellipsis;的办法
- 关于firefox不支持text-overflow:ellipsis;的解决办法
- text-overflow: ellipsis 的兼容性
- 设置text-overflow: ellipsis后引起的文本对齐问题
- CSS实现text-overflow:ellipsis的效果
- text-overflow:ellipsis的巧妙运用
- text-overflow:ellipsis的巧妙运用
- text-overflow:ellipsis的巧妙运用
- text-overflow:ellipsis的巧妙运用
- text-overflow:ellipsis;
- text-overflow:ellipsis用法
- text-overflow:ellipsis
- text-overflow: ellipsis;
- text-overflow: ellipsis 多行
- text-overflow:ellipsis
- text-overflow: ellipsis;
- 打开快速开机时,动画播放不完整
- PCI9054的DMA传输过程
- 在处理大文件时使用yield
- 解释清楚Laravel的Service Container, Service Provider,Contracts和Facade之间的关系
- iptables设置Linux全局代理
- firefox中text-overflow:ellipsis的问题
- Android 通知栏Notification的整合 全面学习 (一个DEMO让你完全了解它)
- MVC和WebApi 使用get和post 传递参数。
- Java网络编程精解之ServerSocket用法详解一
- 计算机网络笔记
- error LNK2026: 模块对于 SAFESEH 映像是不安全的
- 将excel表格转化为html文本
- AndroidStudio的Gradle的分析(非配置,环境原理分析)
- Android 6.0权限模型