css transform rotate

by yidaoj

HTML

<div class="original">
  <div class="rotate box1">
  </div>
</div>

<div class="original">
  <div class="rotate box2">
  </div>
</div>

CSS

body {
  margin: 10px 10px;
}
.original,
.rotate {
  border-radius: 6px;
}
.original {
  width: 80px;
  height: 80px;
  background: #BDBDBD;
  border: 1px dashed #cecfd5;
  float: left;
  margin: 30px 30px;
}
.rotate {
  width: 80px;
  height: 80px;
  background: #2E64FE;
  float: left;
  margin: 0;
}


.box1 {
  transform: rotate(-20deg);
}
.box2 {
  transform: rotate(20deg);
}