Animation to change size - HTML CSS CSS Property

HTML CSS examples for CSS Property:width

Description

Animation to change size

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">

.line_left{
   height:6px;
   width: 32vw;
   background-color:black;
   margin-top:300px;
   margin-left:40px;
   border-radius:5px;
   float:right;
   -webkit-animation:expand 2s; /* Chrome, Safari, Opera */
   animation:expand 2s;
}
/* Chrome, Safari, Opera */
@-webkit-keyframes expand<!--from  w w w .j a va  2s  .  c  o  m-->
{
   from {width: 0vw;}
   to {width:32vw;}
}
/* Standard syntax */
@keyframes expand
{
   from {width: 0vw;}
   to {width:32vw;}
}


      </style> 
 </head> 
 <body> 
  <div class="line_left"></div>  
 </body>
</html>

Related Tutorials