WooCommerce地址字段占位符移除求助:求可用CSS代码
移除WooCommerce地址字段占位符的CSS代码
直接用下面的CSS代码就能隐藏指定的占位符文本:
/* 隐藏"street name and house number"占位符 */ input[placeholder="street name and house number"]::placeholder { color: transparent !important; }
操作步骤(适合无编程基础)
- 登录你的WordPress后台,进入「外观」→「自定义」
- 在自定义面板里找到「额外CSS」(部分主题叫「自定义CSS」)选项
- 把上面的代码粘贴进去,点击「发布」保存即可
如果上面的代码没生效,试试这个针对WooCommerce地址字段的精准代码:
/* 隐藏收货/账单地址第一行的占位符 */ .woocommerce-billing-fields input[name="billing_address_1"]::placeholder, .woocommerce-shipping-fields input[name="shipping_address_1"]::placeholder { color: transparent !important; }
原理是把占位符的文字颜色设为透明,视觉上完全不可见,同时不会影响字段的正常输入功能。
内容的提问来源于stack exchange,提问作者David Uller
相关产品推荐
相关产品推荐

