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

如何将WooCommerce结账页「Continue To Payment」按钮上移150px

Fixing the "Continue To Payment" Button Position in WooCommerce Checkout

Hey there! Let's troubleshoot why your custom CSS isn't moving that button and get it shifted up 150px properly. Here's what you need to do:

1. Verify Your CSS Selector Priority

The most common issue is that your custom selector doesn't have enough weight to override WooCommerce's default styles. Follow these steps to nail down the right selector:

  • Right-click the "Continue To Payment" button and select Inspect Element.
  • Look for the button's unique class or ID in the HTML panel (e.g., it might look like <button class="button wc-proceed-to-payment-button">).
  • Use a more specific selector in your custom CSS to boost priority. For example:
    /* Target the button within the checkout page context */
    .woocommerce-checkout .wc-proceed-to-payment-button {
        /* Your styles here */
    }
    

2. Choose the Right Method to Move the Button

You have two reliable options to shift the button up—pick based on whether you want to affect surrounding layout or not:

Option A: Using margin-top (affects surrounding elements)

This pulls the button up by reducing its top margin, which might shift other elements above it too:

.woocommerce-checkout .wc-proceed-to-payment-button {
    margin-top: -150px;
    /* Add z-index if the button gets hidden behind other content */
    z-index: 10;
}

Option B: Using transform (no layout impact)

This moves the button relative to its original position without disrupting other elements:

.woocommerce-checkout .wc-proceed-to-payment-button {
    transform: translateY(-150px);
}

3. Fix CSS Loading & Cache Issues

If your styles still aren't working:

  • Clear browser cache: Press Ctrl+Shift+R (Windows) or Cmd+Shift+R (Mac) to do a hard refresh.
  • Clear site cache: If you're using a caching plugin (like WP Rocket or W3 Total Cache), purge the cache from your WordPress dashboard.
  • Check CSS loading order: Ensure your custom CSS is loaded after WooCommerce's default styles. Most theme customizers handle this automatically, but if not, you can add your CSS via a child theme's style.css file instead.

4. Last Resort: Use !important (Sparingly)

If all else fails, you can force the style to apply with !important—but only use this if you can't get priority working otherwise:

.wc-proceed-to-payment-button {
    margin-top: -150px !important;
}

内容的提问来源于stack exchange,提问作者Dr.MTR

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.19 10:15:53