简体   繁体   English

无法在PayPal按钮上方和下方调整填充/间距?

[英]Can't adjust padding/spacing above and below PayPal button?

I have several PayPal Add to Cart buttons on the eCommerce section of my site: http://drray.com/bookstore/ and there is so much spacing above and below each button and it doesn't seem to be caused or controlled by any CSS properties. 我在网站的“电子商务”部分上有几个“贝宝添加到购物车”按钮: http : //drray.com/bookstore/ ,每个按钮上方和下方都有很大的间距,这似乎不是由任何按钮引起或控制的CSS属性。 This is a WordPress site. 这是一个WordPress网站。 I can't figure out if I can fix this spacing issue or if I even have any control over it. 我不知道是否可以解决此间距问题,或者甚至对它没有任何控制权。

The buttons are dynamic and I get the code directly from PayPal's site. 这些按钮是动态的,我直接从PayPal的站点获取代码。 It doesn't appear that I can control the button's appearance in any way from PayPal. 我似乎无法从PayPal以任何方式控制按钮的外观。

Any advice on how to fix this extra spacing will be greatly appreciated. 任何有关如何解决此额外间距的建议将不胜感激。

It is becase there are <br> tags in the form: 假设有<br>标签采用以下形式:

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<br>
<input type="hidden" name="hosted_button_id" value="CTXUPNCPMQXPU">
<br>
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<br>
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"><br>
</form>

Removing them will remove the extra space: 删除它们将删除多余的空间:

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="CTXUPNCPMQXPU">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"><br>
</form>

Removing the <br> tags within the paypal form code can help as they add new lines. 删除贝宝表单代码中的<br>标记会有所帮助,因为它们会添加新行。

You could further reduce the spacing by adding this to the paypal images (modify the pixel amounts to what seems right for you: 您可以通过将其添加到贝宝图像中来进一步减小间距(将像素数量修改为适合您的值:

style="margin-bottom:-10px;margin-top:-10px;"

An example of how to use it would be: 如何使用它的一个例子是:

<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" style="margin-bottom: -10px;margin-top:-10px;">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM