I have a CSS rule like * {-webkit-transition:all 0.7s ease}
, This applies to all the elements on the page, but I want to exclude an Element from this rule with ID classic
, how to do this?
The CSS 3 pseudo class for excluding elements is :not
. To exclude all elements matching #classic
, but keep the rest, use
* :not(#classic) {
/* your definitions here */
}
See the W3C spec on selectors. Note that these CSS3 selectors don't work on all browsers, particularly older versions of Internet Explorer will happily ignore them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With