Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery:获取双集或多集规则_Jquery_Css_Bookmarklet - Fatal编程技术网

jQuery:获取双集或多集规则

jQuery:获取双集或多集规则,jquery,css,bookmarklet,Jquery,Css,Bookmarklet,我想得到一个css文件的规则,是双重或多重设置 比如说 #style1 {width:12px;} #style2 {width:12px;} . . . #style1 {width: 12px; height:12px;} 那么jquery应该给我“#style1被定义了两次或多次” 那么,我如何直接处理网站中的css文件和css代码,并检测多个设置规则呢 在每个网站上,它都应该是现成的bookmarklet,而不是一个解决方案,而是一个起点。您可以找到javascript来在样式表

我想得到一个css文件的规则,是双重或多重设置 比如说

#style1 {width:12px;}

#style2 {width:12px;}

.
.
.

#style1 {width: 12px; height:12px;}
那么jquery应该给我“#style1被定义了两次或多次”

那么,我如何直接处理网站中的css文件和css代码,并检测多个设置规则呢


在每个网站上,它都应该是现成的bookmarklet,而不是一个解决方案,而是一个起点。您可以找到javascript来在样式表中查找css规则。你可以用它来检查每一条规则,然后你就可以找到你要去的地方。

如果你的主要目标不是构建一个工具,而是清理你自己的样式表,那么它也可能对你有用。它有一个选项来组合重复选择器的规则(小心使用),似乎我必须开发所需工具的大部分部分,但这一个对我有很大帮助