1

Trying to hide an element in the WooCommerce plugin for Wordpress. Basically it's on the check out page and it says "State" and I want to hide it because the drop down box already says "Select State." I open Firebug and saw that the text "State" is not part of a class or anything. It looks like this:

<label class="" for="billing_state">
State
<abbr class="required" title="required">*</abbr>
</label>

I tried adding this in my CSS but it didn't work

label [for="billing_state"]{
display: none;
}
4

3 回答 3

2

你的 CSS 工作只是删除和之间的label空间[selector]

label[for="billing_state"]{
  display: none;
}

演示http://jsfiddle.net/6hKPL/

于 2013-11-12T21:22:33.673 回答
1

label[;之间不应该有空格。否则,您正在搜索匹配的 a的后代元素。label[for="billing_state"]

label[for="billing_state"]{
    display: none;
}

http://jsfiddle.net/J3BgS/

于 2013-11-12T21:22:15.613 回答
0

您可以使用选择具有空属性<span class="" />的节点

span[class=""] {
    border: 3px solid red;
}

您可以使用明确地选择没有类属性<span />的节点

span:not([class]) {
    border: 3px solid blue;
}

演示

于 2013-11-12T21:25:49.950 回答