Simple Rotation

In this example below you will see how to do a Simple Rotation with some HTML / CSS and Javascript

This awesome code was written by richardkalehoff, you can see more from this user in the personal repository.
You can find the original code on
Copyright richardkalehoff ©
  • HTML
  • CSS
<!DOCTYPE html>
<html lang="en" >

  <meta charset="UTF-8">
  <title>Simple Rotation</title>
      <link rel="stylesheet" href="css/style.css">



  <div id="square"><div>



/*Downloaded from */
#square {
  width: 100px;
  height: 100px;
  background: red;
  margin: 2em auto;
  transform: rotate(45deg);