CodePen

HTML

            
              <div class="box"></div>

<button>click me</button>
            
          
!

↑ Insert the most common viewport meta tag

CSS

            
              .box {
  background: lightblue;
  width: 200px;
  height: 200px;
  margin: 20px auto;
  transition: transform 1s linear;
  transform-origin: top left;
  transform-style: preserve-3D;
}

.box-rotate {
  transform: rotate(360deg);
}

button {
  display: block;
  margin: auto;
}
            
          
!
? ?
? ?
Must be a valid URL.
+ add another resource
via CSS Lint

JS

            
              $('button').click(function () {

  $('.box').toggleClass('box-rotate');

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