纯css实现省略号,兼容火狐,IE9,chrome
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>多行文本实现省略号显示</title>
</head>
<style type="text/css">
/*纯css实现省略号,兼容火狐,IE9,chrome*/
.wrap{
height:40px;line-height:20px;overflow: hidden;width:500px;background:#999;
}
.wrap .text{
float:right;margin-left:-5px;width:500px;word-break: break-all;
}
.wrap::before{
float:left;width:5px;content:'';height:40px;
}
.wrap::after{
float:right;content:'...';height:20px;line-height:20px;
width:30px;margin-left:-30px;/*更改宽度和边距,移动省略号位置*/
position:relative;left:100%;top:-20px;
padding-right:5px;background:#999;
}
</style>
<body>
<div class="wrap">
<div class = "text">
ceshi测试ceshi测试ceshi测试ceshi测试ceshi测试ceshi测试ceshi测试ceshi测试ceshi测试ceshi测试ceshi测试ceshi测试ceshi测试ceshi测试ceshi测试ceshi测试ceshi测试ceshi测试ceshi测试ceshi测试ceshi测试
</div>
</div>
</body>
</html>
纯css实现省略号,兼容火狐,IE9,chrome的更多相关文章
- 兼容火狐,Chrome,IE6,IE7,IE8的HTML换行写法
本文链接:https://java-er.com/blog/html-break-line-firefox-chrome/ 兼容火狐,Chrome,IE6,IE7,IE8的HTML换行写法1.任意数据 ...
- css--两行显示省略号兼容火狐浏览器
css--两行显示省略号兼容火狐浏览器 正常写法: .ellipse1{overflow: hidden;white-space: nowrap;text-overflow: ellipsis;} . ...
- 页面元素固定在页面底部的纯css代码(兼容IE6)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- css zoom属性兼容ie,firefox,chrome
jquery代码: $("body").css({ "zoom":"2", "transform":"scal ...
- input框设置onInput事件只能输入数字,能兼容火狐IE9
使用onInput()事件 onInput()是 HTML5 的标准事件,对于检测 textarea, input:text, input:password 和 input:search 这几个元素通 ...
- css把超出的部分显示为省略号的方法兼容火狐
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/stri ...
- JavaScript自定义浏览器滚动条兼容IE、 火狐和chrome
今天为大家分享一下我自己制作的浏览器滚动条,我们知道用css来自定义滚动条也是挺好的方式,css虽然能够改变chrome浏览器的滚动条样式可以自定义,css也能够改变IE浏览器滚动条的颜色.但是css ...
- 用纯css改变下拉列表select框的默认样式(不兼容IE10以下)
在这篇文章里,我将介绍如何不依赖JavaScript用纯css来改变下拉列表框的样式. 事情是这样的,您的设计师团队向您发送一个新的PSD(Photoshop文档),它是一个新的网站的最终设计 ...
- js控制固定div和随屏滚动div兼容多浏览器和纯css控制(来自网络)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
随机推荐
- oc界面开发整理
oc界面开发整理 ViewController.h from test82 #import <UIKit/UIKit.h> @interface ViewController : UIVi ...
- 【phpstudy2016】apache配置Tp5.0,获取表单数据总是多了一个路由变量,解决
1.用的apahce配置tp5.0的php环境 2.发现input()过来的数据,总是多了一个变量,那就是路由变量, 类似[array(2) { ["/index/index/form_su ...
- Android固件img文件的解包, 修改和打包的命令行操作
Android固件img文件的解包打包 To Unpack-Modify-Pach the system.img, I have followed the following procedure: a ...
- etcd启动报错:couldn't find local name "default" in the initial cluster configuration
启动etcd的时候报错: # systemctl restart etcd Job for etcd.service failed because the control process exited ...
- 关于“javax.servlet.include.request_uri”属性值 include 请求 RequestDispatcher.include
在springMVC的DispatcherServlet类的doService方法中有如下代码: 1 2 3 4 5 6 7 8 9 10 if (WebUtils.isIncludeRequest( ...
- Web容器中DefaultServlet详解 JspServlet DefaultServlet
Web容器中DefaultServlet详解 https://blog.csdn.net/qq_30920821/article/details/78328608 Web容器中DefaultServl ...
- DOS批处理中%~dp0表示什么意思
https://www.jianshu.com/p/5a1a882ead95 https://www.cnblogs.com/cnpirate/p/5282324.html https://www.c ...
- python 3环境下,离线安装模块(modules)
说明: 需要在环境中安装python的模块,但是无法联网,就通过在Pypi上下载离线模块的包进行安装 安装过程: 1.下载模块,如PyMySQL-0.9.3.tar.gz,下载地址:https://f ...
- 分布式事务一2PC
分布式事务解决方案之2PC(两阶段提交) 前面已经学习了分布式事务的基础理论,以理论为基础,针对不同的分布式场景业界常见的解决方案有2PC.TCC.可靠消息最终一致性.最大努力通知这几种. 3.1.什 ...
- 设置ESXi宿主机开机自动启动虚拟机
转载于 https://blog.csdn.net/Form_/article/details/71170813 在百度上面找了一圈都是讲ESXi6.0之前的版本,在VMware vSphere Cl ...