CodePen

HTML

            
              <div id="go">

		<a href="#go">Animate</a> <a href="#reset">Reset</a>

		<p>All of the animations below last exactly 2 seconds</p>

		<div class="ease">
			<h2>Ease (default)</h2>
			<div class="box">
			</div>
		</div>

		<div class="linear">
			<h2>Linear</h2>
			<div class="box">
			</div>
		</div>

		<div class="ease-in">
			<h2>Ease In</h2>
			<div class="box">
			</div>
		</div>

		<div class="ease-out">
			<h2>Ease Out</h2>
			<div class="box">
			</div>
		</div>

		<div class="ease-in-out">
			<h2>Ease In-Out</h2>
			<div class="box">
			</div>
		</div>

	</div>
            
          
!

↑ Insert the most common viewport meta tag

CSS

            
              .box {
  background: blue;
  width: 40px;
  height: 40px;
  -webkit-transition-duration: 2s;
  transition-duration: 2s;
}

.linear .box {
  -webkit-transition-timing-function: linear;
  transition-timing-function: linear;
}
.ease-in .box {
  -webkit-transition-timing-function: ease-in;
  transition-timing-function: ease-in;
}
.ease-out .box {
  -webkit-transition-timing-function: ease-out;
  transition-timing-function: ease-out;
}
.ease-in-out .box {
  -webkit-transition-timing-function: ease-in-out;
  transition-timing-function: ease-in-out;
}

#go:target .box {
  -webkit-transform: translate(300px);
  transform: translate(300px);
}

body {
  font: .7em Arial;
}

h2 {
  margin: 20px 0 5px;
}

a {
  padding: 5px 10px;
  background: blue;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-size: 1.2em;
  margin: 10px 0;
  display: inline-block;
}

a:hover {
  opacity: 0.6;
}

p {
  font-size: 1.2em;
}
            
          
!
? ?
? ?
Must be a valid URL.
+ add another resource
via CSS Lint

JS

            
              
            
          
!
Must be a valid URL.
+ add another resource
via JS Hint
Loading ..................