css 육각형 만들기

준영·2022년 8월 29일
0

코드 지갑..

목록 보기
7/20

html

<div id="hexagon">
  <div class="el01_box">
    <div class="el01_number">01</div>
    <div class="el01_title">PNEUMA, THE SPACE OF LIFE</div>
  </div>
  <div class="el01_box">
    <div class="el01_number">01</div>
    <div class="el01_title">PNEUMA, THE SPACE OF LIFE</div>
  </div>
  <div class="el01_box">
    <div class="el01_number">01</div>
    <div class="el01_title">PNEUMA, THE SPACE OF LIFE</div>
  </div>
  <div class="el01_box">
    <div class="el01_number">01</div>
    <div class="el01_title">PNEUMA, THE SPACE OF LIFE</div>
  </div>
</div>

css (scss)

.slide_sideBar {
        position: absolute;
        top: 620px;
        right: 300px;
        z-index: 1;
        #hexagon {
          position: absolute;
          width: 156px;
          height: 180px;
          background: white;
        }
        #hexagon::before {
          content: "";
          position: absolute;
          top: -42.8675px;
          left: 0;
          width: 0;
          height: 0;
          border-left: 78px solid transparent;
          border-right: 78px solid transparent;
          border-bottom: 42.8675px solid white;
        }
        #hexagon::after {
          content: "";
          position: absolute;
          bottom: -42.8675px;
          left: 0;
          width: 0;
          height: 0;
          border-left: 78px solid transparent;
          border-right: 78px solid transparent;
          border-top: 42.8675px solid white;
        }
      }

결과

profile
개인 이력, 포폴 관리 및 기술 블로그 사이트 👉 https://aimzero-web.vercel.app/

0개의 댓글