css transition move left to right code example

Example 1: css animation left to right

//css code
#leftToRight{
  animation: run ease 3s;
  -webkit-animation: run ease 3s;
  -moz-animation: run ease 3s;
  -o-animation: run ease 3s;
  -ms-animation: run ease 3s;
}   

@keyframes run {
  0% { margin-left: -98%;}
  100%{ margin-left: 0%;}
}

@-moz-keyframes run {
  0% { margin-left: -98%;}
  100%{ margin-left: 0%;}
}

@-webkit-keyframes run {
  0% { margin-left: -98%;}
  100%{ margin-left: 0%;}
}

@-o-keyframes run {
  0% { margin-left: -98%;}
  100%{ margin-left: 0%;}
}

@-ms-keyframes run {
  0% { margin-left: -98%;}
  100%{ margin-left: 0%;}
}

//html code
<div id="leftToRight"></div>

Example 2: how to use the transition left in css

nav:hover {
  left: 0;
  transition: 2s;
}

Tags:

Css Example