Site logo

Archived topic

'Add to Basket' button with white borders

4 replies · Started by Juned on January 14, 2021

Viewing posts 1–5 of 5

Hi,

Can I display 'Add to Basket' button with White Borders?

If yes, then I can set hover background color and text color as per my choice.

Hi there,

to add a border to the add to cart button requires some CSS:

.woocommerce ul.products li.product a.add_to_cart_button {
  border: 1px solid #fff;
}

The button gets its colors from the Customizer > Colors > Buttons.
If you want to set the Add to Cart button to a different color ( not matching the theme styles ) then you can use this CSS instead ( it includes the border ):

/* Add to cart static color */
.woocommerce ul.products li.product a.add_to_cart_button {
    border: 1px solid #fff;
    background-color: #0F0;
    color: #000;
}
/* Add to cart hover color */
.woocommerce ul.products li.product a.add_to_cart_button:hover {
    border: 1px solid #fff;
    background-color: #f00;
    color: #fff;
}

Thanks. It's working perfectly.

Resolved

Glad to hear that!

This archived topic is closed to new replies.