- This topic has 5 replies, 2 voices, and was last updated 4 years ago by
Elvin.
-
AuthorPosts
-
October 14, 2021 at 6:52 pm #1963886
psychederik
I’m a n00b and still trying to figure out how to style the “WooCommerce drop-down cart” and the “item count background color.” Left an below img as reference.
I’ve tried different bits of code I wrote after Inspecting and peeping it’s class name? Sorry, still not well adjusted to CSS terminology.
October 14, 2021 at 7:40 pm #1963900Elvin
StaffCustomer SupportHi there,
If you want to change the background of the container and the total/subtotal, try this CSS:
div#wc-mini-cart { background-color: red; color: white; }
For the RED THAI – 500G font color, try this:
#wc-mini-cart a:not(.button), #wc-mini-cart a.remove { color: white; }
If it’s the color of the basket icon and the item counter on it, try this CSS:
.menu-bar-items a.shopping-bag.has-svg-icon { color: green; }
October 14, 2021 at 8:05 pm #1963910psychederik
My apologies, I butchered my explanation as to what I needed.
1) I want to target each specific button in the dropdown cart (“View Cart” and “Checkout”). I want to give the ViewCart button a white-bg with blue text without effecting the Checkout button.
2) I also want to target the number indicated next to the basket and its background. In the image I posted, the “1” is pink and the circular background is “light grey” to the right of the cart/basket.
October 14, 2021 at 8:25 pm #1963917Elvin
StaffCustomer SupportFor #1:
If it’s for both the buttons, try this CSS:
div#wc-mini-cart p.woocommerce-mini-cart__buttons.buttons a.button.wc-forward { background-color: green; color: pink; }
If you want to style them individually, try this:
/* Minicart viewcart button */ div#wc-mini-cart p.woocommerce-mini-cart__buttons.buttons a[href*="/cart"] { background-color: green; color: pink; } /* Minicart checkout button */ div#wc-mini-cart p.woocommerce-mini-cart__buttons.buttons a[href*="/checkout"] { background-color: aqua; color:white; }
For #2:
This CSS I’ve provided works:
.menu-bar-items a.shopping-bag.has-svg-icon { color: green; }
But if just the counter and rounded background, try this instead:
.cart-contents > span.number-of-items { color: white; background-color: red; }
October 15, 2021 at 5:56 pm #1964916psychederik
Beautiful. Yes, all of the CSS you’ve sent me works as intended. I was looking to only target the number of items in the basket and not the basket itself and the last bit of code you sent achieves perfectly. Thank you for your help.
October 17, 2021 at 10:38 pm #1966788Elvin
StaffCustomer SupportNo problem. Glad to be of any help. 😀
-
AuthorPosts
- You must be logged in to reply to this topic.