代码: 全选
div#sohuplayer{display:none !important;}
所以, 我想写一个类似
代码: 全选
embed#player[0-9]+{display:none !important;}
foo[href^="baidu.com"]{color:red} /*选择foo标签的href属性值以baidu.com开头的所有元素*/
foo[href$=".com"]{color:red} /*选择foo标签的href属性值以.com结尾的所有元素*/
foo[href*="baidu"]{color:red} /*选择foo标签的href属性值中包含有baidu的所有元素*/
代码: 全选
#sohuplayer > embed[id^="player0"]{display:none !important;}
#sohuplayer > embed[id^="player1"]{display:none !important;}
#sohuplayer > embed[id^="player2"]{display:none !important;}
...
代码: 全选
#sohuplayer > embed:not(#player){display:none !important;}
不支持regexp太不好了.astolia 写了:CSS选择器语法不支持这种。。。你只能用子串匹配或者条件取反:
foo[href^="baidu.com"]{color:red} /*选择foo标签的href属性值以baidu.com开头的所有元素*/
foo[href$=".com"]{color:red} /*选择foo标签的href属性值以.com结尾的所有元素*/
foo[href*="baidu"]{color:red} /*选择foo标签的href属性值中包含有baidu的所有元素*/条件取反要简单点代码: 全选
#sohuplayer > embed[id^="player0"]{display:none !important;} #sohuplayer > embed[id^="player1"]{display:none !important;} #sohuplayer > embed[id^="player2"]{display:none !important;} ...
代码: 全选
#sohuplayer > embed:not(#player){display:none !important;}
代码: 全选
{embed:not(#player){display:none !important;}