简体   繁体   中英

CSS :not selector for divs within a div

I want the Woocommerce add to cart button to look different on my homepage and on one other page.

I would like to do this:

    .add-to-cart-button-inner a:not(.home .add-to-cart-button-inner a, .page-132 .add-to-cart-button-inner a ) {
    some-css:here
    }

but Wordpress gives off an error.

Is there a working way to do this?

:not() is a pseudo selector and requires a simple selector as an argument . In your example, you are using a compound argument as your selector - likely the cause of your error.

Try something like:

.add-to-cart-button-inner a:not(.custom-selector-here) {
  background: red;
}

If you need more help, please provide more information about your error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM