Alpha_Boy
小狐狸
小狐狸
  • UID29841
  • 注册日期2009-07-27
  • 最后登录2012-05-01
  • 发帖数54
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
阅读:5728回复:10

▲(第三次改进)为火狐添加“小说蓝”和“苹果绿”的扩展及CSS代码。

楼主#
更多 发布于:2009-07-27 23:05
▲(第三次改进)为火狐添加“小说蓝”和“苹果绿”的扩展及CSS!

感谢https://www.firefox.net.cn/forum/viewforum.php?f=5论坛中的hzhbest、ytzong、hitsmaxft、smoke等资深玩家的帮助,本文中所涉及

的CSS代码现在不会影响到导航工具栏、标题栏、状态栏等火狐主界面中的栏目了。

当然,也感谢Opera Software小组为我们提供了最初的源代码~~
------

首先安装网友zeroieme介绍的加载自定义CSS层叠样式表的stylish扩展,以下是它的历史版本下载页面(挑一个比较新的,能兼容你正在使用

的火狐的版本,点右边的“安装到 Firefox”就行):

https://addons.mozilla.org/zh-CN/firefo ... sions/2108

以下是可用于2.0.0.20版火狐的0.5.9版stylish的下载链接:

https://addons.mozilla.org/zh-CN/firefo ... +tb+sm.xpi

或:

http://ftp.mozest.com/addons/extensions ... +zm+tb.xpi

安装完毕重启火狐后,请依次点击右下角状态栏中新出现的“Stylish”按钮-->管理样式-->“撰写”;接下来,在“描述”一栏中输入你要添

加的CSS样式表的名字,例如“(1)显示蓝色背景”,

然后把下面的所有代码都复制下面的输入窗口中去:

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

@-moz-document url-prefix(http://), url-prefix(ftp://), url-prefix(file://), url-prefix(https://) {
/* Name: (1)显示蓝色背景
High contrast (W/B)
Copyright 2007 Opera Software */


body,
div,
td
/* ,p */
 {
background-color: #E7F4FE !important;
}

*{
color: black !important;
}

input, textarea, select {
color: black !important;
background: #E7F4FE !important;
}

button,
input[type="file"], input[type="submit"],
input[type="button"], input[type="reset"] {
color: black !important;
background: silver !important;
}

a[href]
{text-decoration: underline !important;}

a[href]:hover {
color: black !important;
background: white !important;
}

a[href] img
{border: thin solid white !important;}
}

@media print {
* {
color: black !important;
background: white !important;
}
}

点击“保存”,你立刻就可以看到效果!现在点右上角的“X”按钮,关闭这个管理窗口吧。

以后,你随便打开一个网页,其背景色就都被强制调整为起点中文小说网的小说页面中的那种浅蓝色了。

当然,如果你不想再看到这种背景色的话,也可以取消它:依次点选“Stylish”按钮-->全局样式-->“(1)显示蓝色背景”即可。

下面,再给大家提供一段“显示绿色背景(不可混用)”的CSS代码:

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

@-moz-document url-prefix(http://), url-prefix(ftp://), url-prefix(file://), url-prefix(https://) {
/* Name: (2)显示绿色背景(不可混用)
High contrast (W/B)
Copyright 2007 Opera Software */


body,
div,
td
/* ,p */
 {
background-color: #C7EDCC !important;
}

*{
color: black !important;
}

input, textarea, select {
color: black !important;
background: #C7EDCC !important;
}

button,
input[type="file"], input[type="submit"],
input[type="button"], input[type="reset"] {
color: black !important;
background: silver !important;
}

a[href]
{text-decoration: underline !important;}

a[href]:hover {
color: black !important;
background: white !important;
}

a[href] img
{border: thin solid white !important;}
}

@media print {
* {
color: black !important;
background: white !important;
}
}

顺便一提,这第二段代码和第一段相比,唯一不同的地方就是几处设定背景颜色的16进制代码了。

第一段代码中的“#E7F4FE”(小说蓝),在第二段代码中都被换成了眼科专家推荐的“#C7EDCC”(苹果绿)。从理论上说,你可以将其替换

为其它你喜欢的颜色。

具体各种颜色的16进制代码该怎么转换,可以到百度中去搜索,去看那种名为配色表的参考页面就行。至于我自个儿嘛,我是以前在上初中的

电脑课的时候,用FrontPage去提取了起点中文小说网的页面背景色的R、G、B数值,

然后,再把它们设定到Notepad2 MOD中文版的自定义背景色里,最后把后者自动生成的16进制代码给“道”版了出来~~
******
smoke
千年狐狸
千年狐狸
  • UID3052
  • 注册日期2005-02-16
  • 最后登录2015-02-01
  • 发帖数2367
  • 经验12枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 社区居民
  • 忠实会员
1楼#
发布于:2009-07-27 23:05
加一句
@namespace url(http://www.w3.org/1999/xhtml);

不过界面文本框内还是会变色 等css高人解决
遇到问题请善用论坛搜索功能
ytzong
小狐狸
小狐狸
  • UID28193
  • 注册日期2009-03-07
  • 最后登录2009-11-28
  • 发帖数4
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
2楼#
发布于:2009-07-27 23:05
在选择器前加body比如第一个
body *{color:black !important;background:#E7F4FE !important;}
body input, body textarea, body select{color:black !important;background:#E7F4FE !important;}
body button, body input[type="file"], body input[type="submit"], body input[type="button"], body input[type="reset"]{color:black !important;background:silver !important;}
body a[href]{text-decoration:underline !important;}
body a[href]:hover{color:black !important;background:white !important;}
body a[href] img{border:thin solid white !important;}
Alpha_Boy
小狐狸
小狐狸
  • UID29841
  • 注册日期2009-07-27
  • 最后登录2012-05-01
  • 发帖数54
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
3楼#
发布于:2009-07-27 23:05
呃,对不起啊,我是完全不动代码编写的技术门外汉。

什么叫选择器?能否请楼上的朋友,直接把修改过后的完整代码发上来?
hitsmaxft
非常火狐
非常火狐
  • UID25803
  • 注册日期2008-08-12
  • 最后登录2024-01-13
  • 发帖数740
  • 经验13枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
4楼#
发布于:2009-07-27 23:05
Alpha_Boy:呃,对不起啊,我是完全不动代码编写的技术门外汉。

什么叫选择器?能否请楼上的朋友,直接把修改过后的完整代码发上来?
回到原帖


id class 这些都是选择器

简单地说就是{前面的那些限定词

Lost in fx...
hitsmaxft
非常火狐
非常火狐
  • UID25803
  • 注册日期2008-08-12
  • 最后登录2024-01-13
  • 发帖数740
  • 经验13枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
5楼#
发布于:2009-07-27 23:05
input.post, textarea.post, select {

管的就是输入框,background改为#ffffff

Lost in fx...
hitsmaxft
非常火狐
非常火狐
  • UID25803
  • 注册日期2008-08-12
  • 最后登录2024-01-13
  • 发帖数740
  • 经验13枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
6楼#
发布于:2009-07-27 23:05
@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document url-prefix(http), url-prefix(file)

{
//.....

}

中间加入代码

Lost in fx...
hzhbest
千年狐狸
千年狐狸
  • UID22640
  • 注册日期2008-01-15
  • 最后登录2017-04-06
  • 发帖数1763
  • 经验476枚
  • 威望3点
  • 贡献值414点
  • 好评度89点
  • 社区居民
  • 忠实会员
7楼#
发布于:2009-07-27 23:05
“@charset”是什么代码?用了的话 Stylish 提示
不可识别的 at-rule 或解析 at-rule 时出错 '@charset'。


下面是我修改的代码(两套代码仅两处颜色代码不同,就不重复了):
@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document url-prefix(http://), url-prefix(ftp://), url-prefix(file://), url-prefix(https://) {
/* Name: (1)显示蓝色背景
High contrast (W/B)
Copyright 2007 Opera Software */


body, 
div, 
td
/* ,p */
 {
background-color: #E7F4FE !important;
}

*{
color: black !important;
}

input, textarea, select {
color: black !important;
background: #E7F4FE !important;
}

button, 
input[type="file"], input[type="submit"], 
input[type="button"], input[type="reset"] {
color: black !important;
background: silver !important;
}

a[href] 
{text-decoration: underline !important;}

a[href]:hover {
color: black !important;
background: white !important;
}

a[href] img 
{border: thin solid white !important;}
}

@media print {
* {
color: black !important;
background: white !important;
}
}

这样可以使样式局限于网页中生效,而且保住了一些背景(换言之也使一些地方没用上背景色),效果要好一点。
上面注释掉“p”的一行可以视自己需要去掉注释。
Alpha_Boy
小狐狸
小狐狸
  • UID29841
  • 注册日期2009-07-27
  • 最后登录2012-05-01
  • 发帖数54
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
8楼#
发布于:2009-07-27 23:05
多谢hzhbest、ytzong、hitsmaxft、smoke等资深玩家的帮助。

嗯,“@charset”是Opera浏览器中设定CSS文件编码的代码,去掉应该没关系……
wingpig100
火狐狸
火狐狸
  • UID26905
  • 注册日期2008-11-03
  • 最后登录2016-01-13
  • 发帖数289
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
9楼#
发布于:2009-07-27 23:05
字体的颜色能调整下就好了。
Roysing
小狐狸
小狐狸
  • UID25930
  • 注册日期2008-08-22
  • 最后登录2011-03-20
  • 发帖数65
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
10楼#
发布于:2009-07-27 23:05
Alpha_Boy:呃,对不起啊,我是完全不动代码编写的技术门外汉。

什么叫选择器?能否请楼上的朋友,直接把修改过后的完整代码发上来?
回到原帖


建议简单去了解下css语言,通常是  选择器、属性、数值  组成一个语法的。。。。
游客

返回顶部