firefox通过XUL实现text-overflow:ellipsis的效果
作者:嗷嗷 来源:样式之美 发布时间:2008-07-08 19:12:00
标签:text-overflow,firefox,xul,css
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这种不靠谱的说法也不行,看来人家是铁了心。
0
投稿
猜你喜欢
- 实践是检验真理的唯一途径,本篇只是站在索引使用的全局来定位的,你只需要通读全篇并结合具体的例子,或回忆以往使用过的地方,对整体有个全面认识,
- 在工作和学习中如果同时传输多个文件,大的安装包,python提供了一种无线传输的方法,开启一个本地http服务器,同一局域网下可方便访问 经
- 今天我们使用 Pyecharts 制作一个地球可视化项目,一起来看看吧Let’s go!数据处理这里我们使用全球新冠感染
- 环境管理管理 Python 版本和环境的工具p:非常简单的交互式 python 版本管理工具。官网pyenv:简单的 Python 版本管理
- 错误日志安装时出现了如下错误:SQL Server 2005 安装错误码29503。产品: Microsoft SQL Server 200
- 在 Python 中,你可以使用 sorted() 方法或 sort() 方法对数据进行排序。在本文中,我将提供 sorted() 和 so
- plt.title() 是 matplotlib 库中用于设置图形标题的函数。一、基本语法如下plt.title(label, fontdi
- 1.不转意html entities 一个基本的常识:所有不可信任的输入(特别是用户从form中提交的数据) ,输出之前都要转意。 echo
- 我来教你 js文件怎么通过python访问数据库,希望能够为你带来帮助。1、如果是要提交表单内容给 服务器的 python 处理,那么只需要
- asp之家注:长文章分页算是asp编程中一个比较经典单位问题,怎么分页,什么时候分页.方法挺多,有的是人为的加入分页标志,有的是程序自动加分
- 要求:用户名:必须是6-10位字母、数字、下划线(这里字母、数字、下划线是指任意组合,没有必须三类均包含)不能以数字开头密码:必须是6-20
- Kettle中使用JavaScript调用jar包对文件内容进行MD5加密.本文主要知识点:JavaScript调用jar包对文件内容进行M
- 记得很早以前看到过这样的一段介绍:想象你在逛街边的一家书店,如果最终你没有购买任何图书就直接离开了,店长并不会知道你来过。但是如果你买了书,
- 在javascript开发过程中,如果总是使用alert的方式调试程序,在某些简单的程序中是可行的. 但是在通常的项目很复杂,这
- golang 原生 http 库已经可以很方便地实现一个 http server 了,但对于复杂的 web 服务来说,路由解析,请求参数解析
- 方法一(只有mdf没有日志文件的可以恢复) 证明有效 1.新建同名数据库。 2.把该数据库设置为脱机。 3.删除其日志文件(.LDF),不删
- 每个微信小程序都可以有自己的本地缓存,可以通过 wx.setStorage(wx.setStorageSync)、wx.getStorage
- 前言Scrapy是一个非常好的抓取框架,它不仅提供了一些开箱可用的基础组建,还能够根据自己的需求,进行强大的自定义。本文主要给大家介绍了关于
- #/usr/bin/env python#-*- coding:utf-8 -*-"""1.解析 cronta
- 前言如何通过python实现邮件解析?邮件的格式十分复杂,主要是mime协议,本文主要是从实现出发,具体原理可以自行研究。一、安装通过mai