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
投稿

猜你喜欢

  • python查看列的唯一值方法

    2021-09-20 07:25:46
  • Vue脚手架编写试卷页面功能

    2024-04-27 16:14:36
  • python图片剪裁代码(图片按四个点坐标剪裁)

    2021-03-18 21:07:05
  • SQL Server 2000 作数据库服务器的优点

    2009-01-23 13:47:00
  • ASP 获取腾讯IP地址的代码

    2011-02-26 11:19:00
  • php+mysql开发的最简单在线题库(在线做题系统)完整案例

    2023-08-21 20:03:14
  • 在Python中使用M2Crypto模块实现AES加密的教程

    2022-09-29 17:43:59
  • python实现邮件自动发送

    2023-06-10 16:24:44
  • Navicat连接mysql报错2003(10060)的解决方法

    2024-01-25 06:08:14
  • Python数据类型学习笔记

    2023-02-09 13:42:39
  • python通过smpt发送邮件的方法

    2021-06-18 02:50:59
  • 如何用python合并多个excel文件

    2022-08-23 19:30:24
  • 深入mysql外键关联问题的详解

    2024-01-16 09:19:44
  • SpringCloud Config连接git与数据库流程分析讲解

    2024-01-14 01:29:29
  • Oracle 函数大全[字符串函数,数学函数,日期函数]第1/4页

    2009-03-04 10:56:00
  • 基于Python 的进程管理工具supervisor使用指南

    2021-01-06 20:55:03
  • JS实现淡入淡出图片效果的方法分析

    2023-08-24 08:45:44
  • windows下Mysql多实例部署的操作方法

    2024-01-19 16:33:11
  • 浅谈Python爬取网页的编码处理

    2021-02-03 19:55:56
  • Python实现mysql数据库中的SQL文件生成和导入

    2024-01-22 01:04:41
  • asp之家 网络编程 m.aspxhome.com