英文:
Hide form labels with CSS on "My Account Page -> Addresses"
问题
Please check on this picture for a better understanding.
I could hide the input field for Población field which is actually the shipping_city
, for this purpose I used:
#shipping_city {
display: none;
}
and it works!
However, I cannot hide the label Población
I tried:
label[for="shipping_city"] {
display: none;
}
With no success.
英文:
Please check on this picture for a betther understanding.
I could hide the input field for Población field which is actualy the shipping_city
,
for this purpose I used:
#shipping_city {
display: none;
}
and works!
However, I can not hide the label Población
I tried:
label[for="shipping_city"] {
display: none;
}
With no success
答案1
得分: 0
也许您的标签标签是通过脚本显示的。因此,在您的CSS中添加'!important',就像这段代码一样。
label[for="shipping_code"]{
display:none; /* 不起作用 */
display:none!important; /* 起作用 */
}
英文:
maybe your label tag show with script.
So, add '!important' at your css, like this code.
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
$("label[for='shipping_code']").show();
<!-- language: lang-css -->
label[for="shipping_code"]{
display:none; /* not_woriking */
display:none!important; /* woriking*/
}
<!-- language: lang-html -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<label for="shopping_code">test</label>
<!-- end snippet -->
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论