这是html代码
<div class="field">
<label for="billing:region_id" class="">
<em style="display: none;">*</em>city
</label>
<div class="input-box">
<select id="billing:region_id" name="billing[region_id]" title="縣市" class="" style="display: none;" defaultvalue="">
<option value="">please select</option>
</select>
<script type="text/javascript">
//<![CDATA[
$('billing:region_id').setAttribute('defaultValue', "");
//]]>
</script>
<input type="text" id="billing:region" name="billing[region]" value="" title="region" class="input-text">
</div>
</div>
我想隐藏
<input type="text" id="billing:region" name="billing[region]" value="" title="region" class="input-text">
使用CSS
#billing:region
{
display: none;
}
但它不起作用。有人知道问题出在哪里吗?
最佳答案
元字符需要使用斜杠:
#billing\:region {
display: none;
}
Comment response:
像这样?
[for="billing\:region"]{
display: none;
}
关于html - 无法使用 css 隐藏带有 ":"的输入字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23332233/