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>
<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;
}
-o-text-overflow:ellipsis;/*for opera*/
-moz-binding:url('ellipsis.xml#ellipsis');/*for firefox,需要下面的xml才有效*/
display:block;/*这几个是额外项,加上之后 上面样式才会有效果*/
white-space:nowrap;
overflow:hidden;
}
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步