Css transform without overwriting previous transform - HTML CSS CSS Animation

HTML CSS examples for CSS Animation:Transform

Description

Css transform without overwriting previous transform

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
div {<!-- w w  w  .  ja  v a 2  s.c o  m-->
   --translateX:11px;
   transform:translateX(var(--translateX)) scale(2.6);
}

div:hover {
   --translateX:6px;
}

div {
   transition:.3s transform;
   width:51px;
   height:51px;
   background:salmon;
}
</style> 
 </head> 
 <body> 
  <div></div>  
 </body>
</html>

Related Tutorials