<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>ellipsis</title>
<style>
.demo{
margin:10px;
border:1px solid #ccc;
float:left;
width:115px;
overflow:hidden;
white-space:nowrap;
-o-text-overflow:ellipsis;
text-overflow:ellipsis;
-moz-binding: url('ellipsis.xml#ellipsis');
}
</style>
</head>
<body>
<div class="demo">
short
</div>
<div class="demo">
this is test,this is test,this is test,this is test,this is test,this is test
</div>
</body>
</html>
另外还有一个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>