Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何用css3替换图像的标签?_Css - Fatal编程技术网

如何用css3替换图像的标签?

如何用css3替换图像的标签?,css,Css,我有一个类似的代码 <ul id="payment-methods"> <li> <input class="payment-method" id="gateway_4063663" name="gateway" type="radio" value="4063663"> <label for="gateway_4063663">PagSeguro</label> </li> <li>

我有一个类似的代码

<ul id="payment-methods">
  <li>
    <input class="payment-method" id="gateway_4063663" name="gateway" type="radio" value="4063663">
    <label for="gateway_4063663">PagSeguro</label>
  </li>
  <li>
    <input class="payment-method" id="gateway_4068219" name="gateway" type="radio" value="4068219">
    <label for="gateway_4068219">Cash on Delivery (COD)</label>
  </li>
</ul>

但是什么也没发生…

我建议你,用一个
标签,改变
的背景


帕格塞古罗
更改
的背景图像,并将标签的不透明度设置为0。

我找到了解决方案

正如我提到的,我的xpath是错误的。。。正确的路径是

#payment-methods li label[for="gateway_4063663"] { content: url('pic_1.gif') } #支付方式li标签[for=“gateway_4063663”]{ 内容:url('pic_1.gif') }
很遗憾,我无法更改html。。。无法访问javascript。。。我需要与一个几乎完全关闭的电子商务结帐页面交互,只有CSS公开应用主题。该页面仅以文本形式列出支付网关,我需要将其转换为更奇特的样式…如何访问标签?因为我认为路径不正确,因为当我尝试路径
#支付方法li#gateway4063663标签
时,我无法更改任何内容。。。没有颜色…我只是检查你的回复,很高兴你找到了答案。
<div class="TEST">
   <label for="gateway_4063663">PagSeguro</label>
</div>
#payment-methods li label[for="gateway_4063663"] { content: url('pic_1.gif') }