css把超出的部分显示为省略号的方法兼容火狐

时间:2010-10-07 09:02:44 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">   
<html>   
<head>   
<meta http-equiv="Content-Type" c>   
<title>css把超出的部分显示为省略号的方法兼容火狐_脚本之家</title>   
<style>   
* { margin: 0; padding: 0; }    
a { text-decoration: none; color: #000; }    
a:hover { text-decoration: none; color: #000; }    
ul {    
width: 300px;    
margin: 40px auto;    
padding: 12px 4px 12px 24px;    
border: 1px solid #D4D4D4;    
background: #F1F1F1;    
}    
li { margin: 12px 0; }    
li a {    
display: block;    
width: 80px;    
overflow: hidden;/*注意不要写在最后了*/    
white-space: nowrap;    
-o-text-overflow: ellipsis;    
text-overflow: ellipsis;    
}    
/* firefox only */    
li:not(p) {     
clear: both;    
}    
li:not(p) a {    
max-width: 170px;    
float: left;    
}    
li:not(p):after {    
content: "...";    
float: left;    
width: 25px;    
padding-left: 5px;    
color: #000;    
}    
</style>   
</head>   
<body>   
<ul>   
<li><a href="#">suntear的技术空间</a></li>   
<li><a href="#">suntear的技术空间</a></li>   
<li><a href="#">suntear的技术空间</a></li>   
<li><a href="#">suntear的技术空间</a></li>   
<li><a href="#">suntear的技术空间</a></li>   
<li><a href="#">suntear的技术空间</a></li>   
<li><a href="#">suntear的技术空间</a></li>   
</ul>   
</body>   
</html> 

标签:css,超出的部分,省略号,兼容火狐
0
投稿

猜你喜欢

  • 使用Python操作PDF文件

    2022-01-01 06:15:12
  • asp如何使用MsChart制图工具?

    2010-06-05 12:40:00
  • Pandas中DataFrame的常用用法分享

    2022-08-10 01:17:49
  • MySQL中Order By多字段排序规则代码示例

    2024-01-22 01:10:35
  • Pytorch实现将label变成one hot编码的两种方式

    2021-08-26 08:45:00
  • python学习之基于Python的人脸识别技术学习

    2021-04-23 22:09:25
  • ASP初学者学习ASP指令

    2008-10-14 17:27:00
  • wxpython中自定义事件的实现与使用方法分析

    2023-02-10 07:50:26
  • Python列出一个文件夹及其子目录的所有文件

    2023-12-08 17:49:01
  • 探讨SQL利用INFORMATION_SCHEMA系统视图如何获取表的主外键信息

    2024-01-23 04:16:36
  • python生成指定长度的随机数密码

    2021-01-24 23:53:17
  • 使用 JSON 进行数据传输

    2008-06-15 07:12:00
  • Vue.js学习之过滤器详解

    2024-05-09 10:40:38
  • Python基础教程之名称空间以及作用域

    2022-08-10 07:51:47
  • python实现五子棋程序

    2022-05-26 23:24:31
  • 如何使用PHP中的字符串函数

    2024-05-11 10:01:52
  • Linux上安装Python的PIL和Pillow库处理图片的实例教程

    2021-01-17 15:22:50
  • 纯JS单页面赛车游戏制作代码分享

    2024-02-23 14:10:17
  • 读"设计的3个C"之构图

    2008-12-24 13:25:00
  • sql server通过脚本进行数据库压缩全备份的方法【推荐】

    2024-01-14 18:26:39
  • asp之家 网络编程 m.aspxhome.com