0

为什么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标签...

4

1 回答 1

4

属性选择器同样特定于类选择器。

如果你想重写这个类,你可以这样写:

input.text-style[type="text"]

检查此决定以获取更多信息属性选择器的特殊性是什么?

阅读此http://www.w3.org/TR/selectors/#specificity

于 2012-07-11T06:53:52.627 回答