You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何移除WooCommerce购物车页面数量框边框(保留增减功能)

解决TwentyTwentyTwo主题WooCommerce购物车数量选择器边框问题

直接用下面的CSS代码就能移除边框同时保留数量增减功能:

/* 移除购物车页面数量输入框的边框 */
.woocommerce-cart .quantity input.qty {
    border: none !important;
    box-shadow: none !important;
}

/* 移除数量增减按钮的边框 */
.woocommerce-cart .quantity .plus,
.woocommerce-cart .quantity .minus {
    border: none !important;
    box-shadow: none !important;
    background-color: transparent; /* 可选:让按钮背景透明,和主题风格更统一 */
}

/* 可选:调整按钮hover状态样式,避免边框重新出现 */
.woocommerce-cart .quantity .plus:hover,
.woocommerce-cart .quantity .minus:hover {
    border: none !important;
    box-shadow: none !important;
}

添加方法:

  • 进入WordPress后台,打开「外观」→「自定义」→「额外CSS」
  • 把上面的代码粘贴进去,保存即可

这段代码仅作用于购物车页面的数量选择器,不会影响其他页面元素,同时完全保留增减按钮的点击功能。

内容的提问来源于stack exchange,提问作者user294265

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.15 13:44:53