当前位置:首页 > Div + CSS

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

canca16年前 (2010-12-29)Div + CSS654

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://www.iant.work/post/267.html

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

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

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

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

列表元素ul ol li dl dt dd释义

DIV CSS网页布局中常用的列表元素ul ol li dl dt dd释义,块级元素div尽量少用,和table一样,嵌套越少越好 ol 有序列表。 <ol><li>……</li><l…

CSS hack浏览器兼容一览表

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

XHTML+CSS兼容性解决方案小集

使用XHTML+CSS构架好处不少,但也确实存在一些问题,不论是因为使用不熟练还是思路不清晰,我就先把一些我遇到的问题写在下面,省的大家四处找。 1.在mozilla firefox和IE中的BOX模型解释不一致导致相差2px解决方法: div{margin:30...…

用 CSS 实现 Firefox 和 IE 都支持的 Alpha 透明效果

有的时候,为了实现一些特殊效果,需要将页面元素变透明,本文介绍的就是用 CSS 实现 Firefox 和 IE 都支持的 Alpha 透明效果。CSS: filter:alpha(opacity=50);       /* I…

关于IE、Firefox、Opera页面呈现异同

以下的东东,有些错误,请注意. 1.document.formName.item("itemName") 问题 说明:IE下,可以 使用document.formName.item("itemName")或document.formName.elements ["elementName"];Fi…

发表评论

访客

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