Use some CSS properties in many selectors without editing HTML or using JS

Posted by OrB on Stack Overflow See other posts from Stack Overflow or by OrB
Published on 2010-05-12T22:59:40Z Indexed on 2010/05/12 23:04 UTC
Read the original article Hit count: 401

Filed under:
|
|

CSS:

.bananaTrans {
  -moz-transition : all 1s ease-in-out;
  -webkit-transition: all 1s ease-in-out;
  transition : all 1s ease-in-out;
}
.bananaClass {
  color: yellow;
}

HTML:

<div class="bananaClass">Banana Banana Banana</div>

The objective is to make every element that has class "bananaClass" inherit the properties of "bananaTrans" without editing the HTML or using JavaScript.

It ("bananaTrans") don't need exactly to be a class, it's just a bunch of properties to be used amongst other selectors.

© Stack Overflow or respective owner

Related posts about css

Related posts about css-selectors