css全相容的字串”截取”

來源:互聯網
上載者:User

以前寫的,放在這裡:

.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;
}

 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.