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

作者:嗷嗷 来源:样式之美 时间:2008-07-08 19:12:00 

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属性让我们简单搞定一大堆问题呢。

然后还不小心发现。hedger悄悄的也实现一样的功能Hacking text-overflow for Firefox,不过还是感觉用XBL简洁方便。。

在很久很久以前,我也在研究,能不能调用firefox处理title的点点点的东东来完成效果,不过一直没实现。之前提出的-moz-text-overflow: ellipsis;via这种不靠谱的说法也不行,看来人家是铁了心。

 

标签:text-overflow,firefox,xul,css
0
投稿

猜你喜欢

  • 概念性产品设计

    2008-06-11 12:57:00
  • 谈谈网页设计中的字体应用 (4) 实战应用篇·下

    2009-11-24 13:13:00
  • oracle应用程序实现打包 的方法

    2009-03-02 10:32:00
  • [欣赏] 情景互动广告

    2008-08-06 12:59:00
  • 网马解密大讲堂——网马解密中级篇(Freshow工具使用方法)

    2009-09-16 15:09:00
  • asp防止同时登陆的问题

    2007-10-26 12:19:00
  • 如何了解SQL的执行频率

    2009-08-26 15:17:00
  • 13家著名科技公司logo标识来历及演变

    2008-02-19 16:42:00
  • MySQL数据库锁机制的相关原理简介

    2010-04-22 15:34:00
  • 查询字符串中包含特殊字符的问题

    2009-01-09 13:13:00
  • ASP中使用Session变量的优缺点

    2007-10-01 18:02:00
  • 分享css处理浏览器兼容问题上的小技巧

    2008-02-03 14:41:00
  • XHTML1.0与HTML兼容指引16条[译]

    2009-06-10 14:45:00
  • Javascript程序优化

    2008-06-02 13:12:00
  • asp 去掉html中的table正则代码函数

    2011-04-06 10:48:00
  • asp如何制作一个简单的翻页程序?

    2010-06-29 21:26:00
  • div遮罩层实现实例代码

    2009-01-11 18:38:00
  • javascript读取Json数据并分页显示,支持键盘和滚轮翻页

    2010-01-06 13:03:00
  • MSSQL中递归SQL查询语句实例说明-

    2011-09-30 11:42:43
  • 怎样缩小SQL Server数据库的日志文件

    2009-01-15 13:08:00
  • asp之家 网络编程 m.aspxhome.com