Site logo

Archived topic

Center align add to cart field and button

3 replies · Started by Alexandre on February 17, 2019

Viewing posts 1–4 of 4

Hi,

I'm struggling with centered alignment on single product page with Add to cart and field on mobile display.

Here is what I have actually :

@media (max-width: 768px) {
    .woocommerce div.product .product_title,
    .price,
    .posted_in,
	.woocommerce div.product form.cart {
		text-align: center;
	}
}

but I can't figure out how to align field & Add to cart button

Thanks your excellent support, as usual !!

Hi there,

Try adding this CSS as well:

@media (max-width: 768px) {
    .woocommerce div.product form.cart div.quantity,
    .woocommerce div.product form.cart .button {
        float: none;
        display: inline-block;
    }

    .woocommerce div.product form.cart .button {
        margin-top: -4px;
    }
}

Excellent,

Thanks a lot

You're welcome :)

This archived topic is closed to new replies.