有几件事,你在这些元素上有边距:
//margin top of the cart section
.woocommerce div.product form.cart, .woocommerce div.product p.cart {
margin-top: 2.45em;
}
//margin bottom under variations table
.woocommerce div.product form.cart .variations {
margin-bottom: 1em;
}
//hidden description section, causes a tiny gap above quantity box
.single_variation {
margin-right: 1em;
}
你在这个元素上有 padding-top 内联:
<div id="wc-stripe-payment-request-wrapper" style="clear:both;padding-top:1.5em;">
<div id="wc-stripe-payment-request-button" style="display: none;">
<!-- A Stripe Element will be inserted here. -->
</div>
</div>
去掉边距和内边距就可以了
更新:
如果 div 来自插件,您可以尝试通过以下方式覆盖它:
#wc-stripe-payment-request-wrapper {
padding-top: 0!important;
}
对于描述部分,你也有一些边距:
.woocommerce div.product div.summary {
margin-bottom: 2em;
}
.woocommerce div.product form.cart {
margin-bottom: 2em;
}
当在移动设备上时,你有这个边距底部:
@media screen and (max-width: 768px) {
.woocommerce #content div.product div.images, .woocommerce #content div.product div.summary, .woocommerce div.product div.images, .woocommerce div.product div.summary {
float: none;
width: 100%;
margin-bottom: 1em;
}
}
你有这个没有内容的类,但也占用了一些空间,不是那么重要,但如果你不需要它,可以尝试删除它:
.product-share-wrap {
}