DEV Community

namlh023
namlh023

Posted on

Solution for Css Battle #19 (Cube)

<div></div>
<style>
  body {
    background-color: #0B2429;
    margin: 0;
  }
  div {
    width: 100px;
    height: 100px;
    background: #F3AC3C;
    transform: rotate(45deg);
    margin-top: 135px;
    margin-left: 150px;
  }

  div:after, div:before {
    content: '';
    position: absolute;
    width: 50px;
    height: 100px;
  }

  div:before {
    background-color: #998235;
    transform: translate(-50px, -25px) skewY(45deg);
  }

    div:after {
    background-color: #1A4341;
    transform: rotate(90deg) translate(-75px, 0px) skewY(135deg);
  }

</style>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)