贝宝智能按钮

问题描述

我正在尝试使用该方法自定义 PayPal 按钮: https://developer.paypal.com/docs/checkout/integration-features/customize-button/

var FUNDING_SOURCES = [
    paypal.FUNDING.PAYPAL,paypal.FUNDING.CARD
];

// Loop over each funding source / payment method
FUNDING_SOURCES.forEach(function(fundingSource) {

    // Initialize the buttons
    var button = paypal.Buttons({



    // Check if the button is eligible
    if (button.isEligible()) {



        // Render the standalone button for that funding source
        button.render('#paypal-button-container');

    }


});


按钮显示正确,但我试图在它们之间添加空格,我该怎么做?我也尝试过“垂直”样式,但它们仍然没有空格。

谢谢!

解决方法

在您的 forEach 循环中,当您将内容渲染到容器 (button.render() 中时,还要添加您想要的任何间距。

,

花了我一段时间,但我找到了解决方案,如果有人需要时尚:

      #paypal-button-container{
}

.paypal-buttons-layout-horizontal {

      margin: 5px;
}