找回密码
 新注册用户
搜索
查看: 3915|回复: 9

firefox3下显示图片占位符的方法

[复制链接]
发表于 2009-3-11 21:44:44 | 显示全部楼层 |阅读模式
因为一直被这个问题困扰,到网上搜索了一下,找到了方法,特来分享。

======================================

占位符测试页面 https://bug58646.bugzilla.mozilla.org/attachment.cgi?id=72516

将以下内容保存到profile\chrome目录下的 userContent.css 文件中
userContent.zip (310 Bytes, 下载次数: 2254)

  1. /*
  2. *显示缺失图像占位符
  3. */


  4. @namespace url(http://www.w3.org/1999/xhtml);

  5. @-moz-document url-prefix(http), url-prefix(file) {
  6.    img:-moz-broken{
  7.    -moz-force-broken-image-icon:1;
  8.    width:24px;
  9.    height:24px;
  10.   }
  11. }
复制代码
该方法只对firefox3有效
官方说明2.0应该是不行:
http://developer.mozilla.org/En/CSS::-moz-broken
"This article covers features introduced in Firefox 3"
-moz-broken应该是3.0才引入的



参考
http://bbs.et8.net/bbs/showthread.php?t=943395
http://www.firefox.net.cn/newforum/viewtopic.php?p=184415

[ 本帖最后由 Julian_Yuen 于 2009-3-14 16:36 编辑 ]
回复

使用道具 举报

发表于 2009-3-14 13:57:22 | 显示全部楼层
我怎么一点变化都没有
  1. /*
  2. * Edit this file and copy it as userContent.css into your
  3. * profile-directory/chrome/
  4. */

  5. /*
  6. * This file can be used to apply a style to all web pages you view
  7. * Rules without !important are overruled by author rules if the
  8. * author sets any.  Rules with !important overrule author rules.
  9. */

  10. /*
  11. * example: turn off "blink" element blinking
  12. *
  13. * blink { text-decoration: none ! important; }
  14. *
  15. */

  16. /*
  17. * example: give all tables a 2px border
  18. *
  19. * table { border: 2px solid; }
  20. */

  21. /*
  22. * example: turn off "marquee" element
  23. *
  24. * marquee { -moz-binding: none; }
  25. *
  26. */

  27. /*
  28. * For more examples see [url]http://www.mozilla.org/unix/customizing.html[/url]
  29. */

  30. /*
  31. *显示缺失图像占位符
  32. */


  33. @namespace url([url]http://www.w3.org/1999/xhtml[/url]);

  34. @-moz-document url-prefix(http), url-prefix(file) {
  35.    img:-moz-broken{
  36.    -moz-force-broken-image-icon:1;
  37.    width:24px;
  38.    height:24px;
  39.   }
  40. }
复制代码
回复

使用道具 举报

 楼主| 发表于 2009-3-14 13:59:51 | 显示全部楼层
放到指定目录后 重启ff3,然后测试页面 https://bug58646.bugzilla.mozilla.org/attachment.cgi?id=72516
回复

使用道具 举报

 楼主| 发表于 2009-3-14 14:02:00 | 显示全部楼层

回复 #2 ledled 的帖子

把那啥[url]去掉
回复

使用道具 举报

发表于 2009-3-14 14:16:42 | 显示全部楼层

回复 #4 Julian_Yuen 的帖子

已经去掉了, 结果还是没有变化
Snap3.jpg

FF的占位符是不是" X "?
回复

使用道具 举报

 楼主| 发表于 2009-3-14 16:37:42 | 显示全部楼层

回复 #5 ledled 的帖子

应该有7个占位符的,见一楼补充的usercontent.css和效果图
回复

使用道具 举报

发表于 2009-3-14 17:30:52 | 显示全部楼层
弱弱地问下具体路径在哪里
回复

使用道具 举报

 楼主| 发表于 2009-3-14 20:28:41 | 显示全部楼层
XP 大概在 C:\Documents and Settings\yourname\Application Data\mozilla\profile\******\chrome\
vista的类似,默认在C:\user下面,找不到的话直接搜索mozilla或者profile或者chrome吧

[ 本帖最后由 Julian_Yuen 于 2009-3-14 20:32 编辑 ]

评分

参与人数 1基本分 +3 收起 理由
ledled + 3 谢谢教主

查看全部评分

回复

使用道具 举报

发表于 2009-3-14 21:23:06 | 显示全部楼层
成功了
回复

使用道具 举报

 楼主| 发表于 2009-3-14 21:33:05 | 显示全部楼层

回复 #9 ledled 的帖子

成功就好
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 新注册用户

本版积分规则

论坛官方淘宝店开业啦~
欢迎大家多多支持基金会~

Archiver|手机版|小黑屋|中国分布式计算总站 ( 沪ICP备05042587号 )

GMT+8, 2024-9-30 13:29

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表