当前位置:首页 > Div + CSS > 正文内容

firefox通过XUL实现text-overflow:ellipsis的效果

canca15年前 (2010-12-29)Div + CSS534

firefox不支持text-overflow一直让人很折腾。。不过还好有大虾为我们提供解决方案。。text-overflow: ellipsis for firefox


Firefox still does not implement the proposed CSS3 text-overflow property. It does however provide a similar behaviour for the XUL description element. Furthermore, it does support XBL bindings through CSS. This leads to the following solution:


.ellipsis { text-overflow: ellipsis; -moz-binding: url('ellipsis.xml#ellipsis');

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


xul:description
的crop原来是那样强。。除了可以点点点掉后面的。。还可以点点点前面或者中间部分的。。这个功能可是非常实用哦,不知道W3C虾米时候也给这样的CSS属性让我们简单搞定一大堆问题呢。

扫描二维码推送至手机访问。

版权声明:本文由Ant.Master's Blog发布,如需转载请注明出处。

本文链接:https://iant.work/post/267.html

标签: Div + CSS
分享给朋友:

“firefox通过XUL实现text-overflow:ellipsis的效果” 的相关文章

div+css布局漫谈

1.CSS布局常用的方法:float : none | left | right 取值:none :  默认值。对象不飘浮 left :  文本流向对象的右边 right :  文本流向对象的左边 它是怎样工作的,看个一行两列的例子 xhtml: <div > <div...

CSS DIV超出范围加(...)

<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>www.aspxuexi.com asp学习网</title&...

P:first-letter P:first-line 示例

<style type="text/css">p { color: red; font-size: 12pt }p:first-letter { color: green; font-size: 200% }p:first-line { color: blue }</style&g...

CSS Hack 汇总快查

屏蔽IE浏览器(也就是IE下不显示) *:lang(zh) select {font:12px  !important;} /*FF,OP可见,特别提醒:由于Opera最近的升级,目前此句只为FF所识别*/ select:empty {font:12px  !import...

CSS hack浏览器兼容一览表

CSS hack是指我们为了兼容各浏览器,而使用的特别的css定义技巧。这是国外摘来的一张CSS hack列表,显示了各浏览器对css hack的支持程度,对我们制作兼容网页非常有帮助。  ...

如何处理不同浏览器之间的样式表的兼容性问题

IE 不支持 "min-height" 样式本站是这样解决的:.contents { ... ...; min-height:380px; ie-only:expression(this.style.height="390px"); } 兼容 IE 和 Mozilla 的 hr 定义Mozilla...

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。