如何更改`中标签的颜色 ` and ` `

问题描述 投票:-1回答:2

我真的想知道如何更改具有属性font-color的特定<label>for="shipping_method_0_774",而它在无序列表和列表项中...

   <ul id="shipping_method" class="woocommerce-shipping-methods">
<li>
    <input type="hidden" name="shipping_method[0]" data-index="0" id="shipping_method_0_774" value="774" class="shipping_method">
    <label for="shipping_method_0_774">Pakketpost Bezorging: GRATIS</label> 
</li>
</ul>

真的希望你帮忙!

先感谢您

html css list label
2个回答
2
投票

使用[]设置您想要的属性

ul li label[for="shipping_method_0_774"]{
color:red;
}
<ul id="shipping_method" class="woocommerce-shipping-methods">
  <li>
    <input type="hidden" name="shipping_method[0]" data-index="0" id="shipping_method_0_774" value="774" class="shipping_method"><label for="shipping_method_0_774">Pakketpost Bezorging: GRATIS</label> </li>
</ul>

为了更具体的当前ul(带id)使用:

#shipping_method li label[for="shipping_method_0_774"]{
color:red;
}

0
投票

这是你想要的吗?

label[for="shipping_method_0_774"] {
  color: red;
}
<label for="shipping_method_0_774">Correct label</label>

<br>

<label for="shipping_method_1337">Random label</label>
© www.soinside.com 2019 - 2024. All rights reserved.