---
title: "纯css实现所有浏览器下的ellipsis"
author: "i_love_sc"
date: "2010-04-22T10:51:35Z"
tags: []
categories: ["Web前端"]
slug: "css-ellipsis"
draft: false
lastmod: "2010-04-22T10:51:35Z"
id: 650189
url: "https://hiyoungjay.iteye.com/blog/650189"
---

css内容：

 

```
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
-moz-binding: url('ellipsis.xml#ellipsis');
```

 

在css同级目录下面ellipsis.xml的内容：

 

```
<?xml version="1.0"?>
<bindings xmlns="http://www.mozilla.org/xbl" xmlns:xbl="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 <binding id="ellipsis">
  <content>
   <xul:window>
    <xul:description crop="end" xbl:inherits="value=xbl:text">
     <children/>
    </xul:description>
   </xul:window>
  </content>
 </binding>
</bindings>
```