为什么我不能从Chrome的userstylesheet Custom.css中导入@? [英] Why can't I @import from Chrome's userstylesheet Custom.css?

查看:67
本文介绍了为什么我不能从Chrome的userstylesheet Custom.css中导入@?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望从Chrome的自定义样式表C:\Users\*\AppData\Local\Google\Chrome\User Data\Default\User StyleSheets\Custom.css中导入其他css文件,但它似乎无法正常工作.我在与上述相同的目录中有一个stylish.1misc.cssstylish.2img.css.同样使用符号链接,我已经在本地服务器上将它们设置为http://localhost/.my/stylish.2img.css,但是@import规则似乎都不起作用

I was hoping to import other css files from withing the Chrome's custom stylesheet C:\Users\*\AppData\Local\Google\Chrome\User Data\Default\User StyleSheets\Custom.css but it doesn't seem to be working. I have a stylish.1misc.css and a stylish.2img.css inside the same dir as above. Also with symlinks I've set them up on my localserver as http://localhost/.my/stylish.2img.css but none of the @import rules seem to be working

@import "stylish.1misc.css";
@import url("stylish.1misc.css");
@import url("http://localhost/.my/stylish.2img.css");
@import url("file:///D:/.localhost/.my/stylish.1misc.css");

为什么不导入?

相关

推荐答案

尽管Chrome也存在相同的问题,但是有关在除IE之外的所有浏览器中都包含本地样式表的声明缺乏优点. Opera,Firefox和Safari均允许包含本地样式表. Safari和Opera甚至允许用户使用位于硬盘上任意位置的样式表.由于指示Web浏览器使用本地样式表的过程需要本地用户的参与,因此,违反安全性的可能性很小,甚至几乎不存在.

Although I am having the same issue with Chrome as well, but the statement concerning inclusion of local stylesheets in case of every browser with the exception of IE lacks merit. Opera, Firefox, and Safari all allow inclusion of local stylesheets. Safari and Opera even allow users to use stylesheets which are located anywhere on their hard disks. As the process of instructing a web browser to use a local stylesheet requires a local user's involvement, hence the chances of violating the security remain minimal to almost non existent.

由于CSS文件必须遵守严格的规则,因此,这可能为用户提供了从硬盘上任何目录中选择本地CSS文件的另一个原因,因为浏览器只是在不进行分析的情况下停止解析该文件.符合预定义的规则和标准.

As CSS files have to conform to strict rules, hence that probably provides another reason for making it possible for users to choose local CSS files from any directory on the hard disk, as browsers simply stop parsing the file in case it does not conform to predefined rules and standards.

这篇关于为什么我不能从Chrome的userstylesheet Custom.css中导入@?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆