문제

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.

도움이 되었습니까?

해결책

You can modify the CSS? Just add an extra .bananaClass selector

.bananaTrans, .bananaClass {
  -moz-transition : all 1s ease-in-out;
  -webkit-transition: all 1s ease-in-out;
  transition : all 1s ease-in-out;
}
.bananaClass {
  color: yellow;
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top