Треугольник Пенроуза

Треугольник Пенроуза на чистом CSS.

HTML

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    body {
      min-height: 100vh;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .block {
      position: relative;
      margin: 0 auto;
      width: 300px;
      height: 260px;
    }

    [class*=f-] {
      position: absolute;
    }

    .f-1 {
      background-color: tomato;
      bottom: 0;
      right: 15px;
      width: 250px;
      height: 44px;
      transform: skewX(-30deg);
    }

    .f-1::before {
      background-color: tomato;
      content: '';
      position: absolute;
      width: 183px;
      height: 37px;
      transform: rotate(270deg);
      left: -73px;
      bottom: 74px;
    }

    .f-2 {
      background-color: burlywood;
      bottom: 132px;
      right: -36px;
      width: 252px;
      height: 39px;
      transform: rotate(59deg) skewX(328deg);
    }

    .f-2::before {
      background-color: burlywood;
      content: '';
      position: absolute;
      width: 211px;
      height: 48px;
      transform: rotate(268.7deg);
      right: -83px;
      bottom: -92px;
    }

    .f-3 {
      background-color: cadetblue;
      top: 86px;
      right: 33px;
      width: 203px;
      height: 38px;
      transform: rotate(59.3deg) skewX(28deg);
    }

    .f-3::before {
      background-color: cadetblue;
      content: '';
      position: absolute;
      width: 221px;
      height: 51px;
      transform: rotate(268.9deg);
      left: -84px;
      top: 86px;
    }

    .f-3::after {
      background-color: burlywood;
      content: '';
      position: absolute;
      width: 28px;
      height: 65px;
      transform: rotate(48deg);
      right: 0;
      bottom: -27px;
    }
  </style>
</head>

<body>

  <div class="block">
    <div class="f-2"></div>
    <div class="f-1"></div>
    <div class="f-3"></div>
  </div>

</body>

</html>
Объявление

Если вы хотите обучаться вместе со мной, то приглашаю вас на индивидуальные курсы HTML Academy: «Профессиональная вёрстка сайтов» или «Адаптивная вёрстка и автоматизация».

Просто спросите у менеджера меня — наставника Зиновьева Александра. Обучение проходит в помесячном индивидуальном формате, и вы можете начать в любое удобное для вас время.

Кроме того, в HTML Academy вы получите профессию и даже сможете устроиться на работу с новой профессией.