css全兼容的字符串"截取"

以前写的,放在这里:

.ellipsis{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;-o-text-overflow:ellipsis;-moz-binding:url('ellipsis.xml#ellipsis');display:block;}

 

ellipsis.xml

复制代码
代码
<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:description crop="end" xbl:inherits="value=xbl:text"> 
        
<children/> 
      
</xul:description> 
    
</content> 
  
</binding> 
</bindings>
复制代码

 

 .ellipsis{

复制代码
    text-overflow:ellipsis;/*for IE ...*/
    -o-text-overflow
:ellipsis;/*for opera*/
    -moz-binding
:url('ellipsis.xml#ellipsis');/*for firefox,需要下面的xml才有效*/
    display
:block;/*这几个是额外项,加上之后 上面样式才会有效果*/
    white-space
:nowrap;
    overflow
:hidden;
}
复制代码

 

posted @   sohighthesky  阅读(647)  评论(4编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示