input.not(li.tagit-new >input) {
background-color: lightgrey;
}
<ul id="tagAdministrator" style="width: 505px" class="tagit ui-widget ui-widget-content ui-corner-all">
<li class="tagit-new" style="box-shadow: none;">
<input type="text" class="ui-widget-content ui-autocomplete-input" autocomplete="off">//css should not be applied to this
</li>
</ul>
<input type="text" class="ui-widget-content ui-autocomplete-input" autocomplete="off"> //css should be applied to this
答案 0 :(得分:2)
您的:not()
伪只能接受simple selectors并需要冒号!
input {background: grey;}
li.tagit-new input {background: purple;}
&#13;
<ul id="tagAdministrator" style="width: 505px" class="tagit ui-widget ui-widget-content ui-corner-all">
<li class="tagit-new" style="box-shadow: none;">
<input type="text" class="ui-widget-content ui-autocomplete-input" autocomplete="off">//css should not be applied to this
</li>
</ul>
<input type="text" class="ui-widget-content ui-autocomplete-input" autocomplete="off"> //css should be applied to this
&#13;
答案 1 :(得分:1)
我会做两种不同的风格:
input {
background-color:lightgrey;
}
li > input {
background-color:white;
}
或者让#&#34;在&#34;以外 - 输入一个班级。