2012-07-11 134 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

回答