Is it possible to create this irregular quadrilateral with CSS?

后端 未结 0 1757
北海茫月
北海茫月 2021-01-13 08:05

I\'ve tried the perspective solution here How to transform each side of a shape separately? but can\'t get it to work probably due to the irregularness

相关标签:
回答
  • 2021-01-13 08:31

    Using CSS borders you can create triangles and trapezoids.

    You can achieve your shape joining a triangle and a trapezoid.

    .triangle {
      border: 0 solid red;
      border-left-width: 500px;
      border-top-width: 30px;
      border-top-color: transparent;
    }
    .trapezoid {
      border: 0 solid red;
      width: 500px;
      border-bottom-width: 150px;
      border-right-width: 30px;
      border-right-color: transparent;
    }
    <div class="triangle"></div>
    <div class="trapezoid"></div>

    0 讨论(0)
  • 消灭零回复
提交回复
热议问题