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 @ 2010-09-29 13:32  sohighthesky  阅读(644)  评论(4编辑  收藏  举报