Is it possible to combine multiple transforms in a single element to create a unique end result?
It seems that when applying multiple transform properties to an element, only one of them will be recognized.
For example, trying to transform a div with both rotate(20deg)
and skewY(20deg)
like this:
.foo {
transform: rotate(20deg);
}
.bar {
transform: skewY(20deg);
}
<div class="foo bar"></div>
Only one transformation will take effect. While combining the transformations manually could work, it's not practical due to the countless potential combinations. Instead, how about doing something like this:
.one {transform: rotate(10deg);}
.two {transform: rotate(20deg);}
.three {transform: rotate(30deg);}
.four {transform: rotate(40deg);}
.uno {transform: skewY(10deg);}
.dos {transform: skewY(20deg);}
.tres {transform: skewY(30deg);}
I am exploring various solutions such as:
- Finding a way to add to the existing transform property of a
<div>
- Potentially modifying classes dynamically
- Utilizing jQuery to change CSS without overwriting existing properties
While I prefer CSS/JavaScript solutions, any input using jQuery is also welcome!