Is there any way to have
a CSS selector "inherit" all declarations from another selector?
For example, imagine I have some simple img transformation rules:
.tilt {
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
-ms-transition: all 0.5s ease;
transition: all 0.5s ease;
}
.tilt:hover {
-webkit-transform: rotate(-10deg);
-moz-transform: rotate(-10deg);
-o-transform: rotate(-10deg);
-ms-transform: rotate(-10deg);
transform: rotate(-10deg);
}
Is there any way to do the following?
body.home.page .box-2 figure img {
/* inherit from .tilt */
}
body.home.page .box-2 figure img:hover {
/* inherit from .tilt:hover */
}
I realize that I could do this simply by adding the "tilt" class to the img tag if I had access to the underlying code, but I don't. I also know I could use javascript to add the tilt class to the img tag at runtime, but all I have access to change is the CSS.
Basically, I want to conserve code by not having to repeat these declarations over and over again in the CSS file. Is there any way to do this? Again, I only have access to the CSS file, nothing else.