Suppose I have two transformations in the transform property, eg:
transform: scale(.5,.5) rotate(10deg);
I know that it is possible to establish the point of origin of the transformations using the property transform-origin
, Ex:
transform-origin: 0 0;
But that point of origin will apply to all transformations of the object.
Is there any way to indicate a different origin point for each transformation?
Example using the method indicated by rnd
* {
margin:0px;
padding:0px;
}
#a{
background-color:green;
width:100px;
height:100px;
display: block;
transition:1s;
transition-timing-function: linear;
transform-origin: left top 0;
}
#a:hover{
transform:scale(.5);
}
#b {
width:100px;
height:100px;
transition:1s;
transition-timing-function: linear;
background-color:red;
transform-origin: right top 0;
}
#b:hover {
transform: rotate(-90deg);
}
<div id="a"><div id="b"></div></div>