Archived topic
How to align buttons to right.?
3 replies · Started by Jusung on March 3, 2023
I am working on product page and I found this is super complicated..
On this page, I want to align "add to cart" and "buy now" buttons to the right.
Could you help with this?
Hi there,
This CSS would work but it's not the best solution as it might impact other elements:
.woocommerce div.product form.cart {
justify-content: flex-end;
}
Are you adding the buttons manually somehow? If so can you wrap a GB container outside?
Let me know :)
Add to cart button is added by the woocommerce plug-in.
I added "buy now" button by adding php code.
So, it is possible to wrap only "buy now" button by div with class.
Can you give me an idea how I can make a button that can be wrapped by gb container?
Your code is working well and it doesn't affect other elements since I have "add to cart" button only on produdct page.
Thank you!
Your code is working well and it doesn’t affect other elements since I have “add to cart” button only on produdct page.
In that case, then I'd say the CSS should be fine.