How to create cube with only HTML and CSS?

前端 未结 9 1980
星月不相逢
星月不相逢 2021-01-30 17:03

I have this and I want to make a cube with HTML & CSS only like in the above image. My best try:

9条回答
  •  春和景丽
    2021-01-30 18:01

    Use the following css for .square3:

    .square3{
      width:110px;
      height:110px;
      background:#c52329;
      float:left;
      transform: rotate(45deg) skew(-15deg, -15deg);
      position: absolute;
      left: 46px;
      top: -42px;
    }
    

提交回复
热议问题