例如,body #wrap p {...},那么它的优先级指数就是 1+100+1=102,而body div#wrap p {...}的优先级指数就是 1+ 1 +100 + 1 =103。 再看一下其它的例子: * { } 0 li:first-line { } 2 (one element, one pseudo-element) ul ol+li { } 3 (three elements) ul ol li.red { } 13 (one class, three elements) style=”” 1000 (one inline styling) div p { } 2 (two HTML selectors) div p.sith { } 12 (two HTML selectors and a class selector) body #darkside .sith p { } 112 (HTML selector, id selector, class selector, HTML selector; 1+100+10+1) 看这段代码: