2012-07-11 131 views
0

为什么CSS选择CSS选择器优先

select, textarea, input[type="text"], input[type="password"],input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input 

优先于

input.text-style 

以下HTML:

<input type="text" required="required" name="poemDataCollector[name]" id="poemDataCollector_name" class="text-style"> 

,我读了类应该对html标签优先...

+0

这就是所谓的特异性价值,我已经发布了好回答一次,让我找到它 – 2012-07-11 06:53:25

+0

http://stackoverflow.com/a/10557730/871050在这里你去 – 2012-07-11 06:55:25

+0

你的第一个选择器应该只优先,如果它是在你的第二个选择器后声明。 – BoltClock 2012-07-11 06:56:13

回答