chrome 33+ 使用 custom.css 设置字体

来源:互联网 发布:rayban眼镜 知乎 编辑:程序博客网 时间:2024/05/29 03:23

chrome33+ 版本之后不能再用 Custom.css来设置字体了, 在网上搜了一下, 发现有其他的办法实现这个功能: http://bbs.kafan.cn/thread-1674386-1-1.html

方法如下:

简单的实现方法是下载附件
 customcss.zip (1.33 KB, 下载次数: 2857) 
解压后拖到扩展管理界面安装即可
在配置文件夹\Default\Extensions\kgmedhinhdocolhpcmikgehmahdjemcn\1.0_0里面可以直接修改custom.css文件
修改后需要重启浏览器才能生效
附件里面的css文件内容如下

  1. /*字体阴影*/
  2. *{text-shadow:0.01em 0.01em 0.1em #999999 !important;}

  3. /*全局雅黑字体*/
  4. *:not([class*="icon"]):not(i){font-family: "Microsoft YaHei" !important;}

  5. /*去除链接下划线*/
  6. a{text-decoration:none !important}

  7. /*淡蓝色文字效果*/
  8. a{-webkit-transition: all 0.3s ease-out;}
  9. a:hover{color: #39F  !important;text-shadow:-5px 3px 18px #39F !important;-webkit-transition: all 0.3s ease-out;}
  10. *::-webkit-selection {background: #333333 !important; color: #00FF00 !important; }
复制代码


我使用的是下面这个配置:

/*设置字体*/*{font-family:"微软雅黑",sans-serif !important; }/*设置字体阴影*/* {text-shadow: silver 0px 0px 0px !important;}/*以下用来高亮输入框*/input[type="text"]:focus, input[type="password"]:focus, textarea:focus{outline: 2px solid #6FA1D9 !important;-webkit-box-shadow:0px 0px 5px #6FA1D9 !important;}input[type="checkbox"]:focus,input[type="submit"]:focus,input[type="reset"]:focus, input[type="radio"]:focus{outline: 1px solid #6FA1D9 !important;}



-------------------------------------------------------------------------------------------
比较复杂的方法是自己创建扩展安装
实现步骤:
1、新建一个文件夹,比如customcss,包含custom.css和manifest.json两个文件
2、manifest.json的内容如下
  1. {
  2.    "content_scripts": [ {
  3.       "css": ["custom.css"],
  4.       "all_frames": true,
  5.       "matches": [ "http://*/*", "https://*/*" ]
  6.    } ],
  7.    "description": "custom.css",
  8.    "name": "Custom CSS",
  9.    "version": "1.0",
  10.    "manifest_version": 2
  11. }
复制代码

description是扩展介绍,name是扩展名字,version是版本号,都可以自己改
3、打开chrome的扩展管理,选择打包扩展程序,扩展程序根目录选择customcss文件夹,私有密匙文件不用管,然后选择打包扩展程序,生成customcss.crx和customcss.pem
4、将customcss.crx拖入扩展管理安装即可
0 0
原创粉丝点击