CSSBattle Apr 23, 2025

zimablue·2025년 4월 23일

CSSBattle

목록 보기
16/31

문제

풀이

HTML

<div class="container">
  <div class="white-box">
    <div class="circle"></div>
    <div class="square"></div>
  </div>
  <div class="white-box flipped">
    <div class="circle"></div>
    <div class="square"></div>
  </div>
</div>

CSS

* {
  box-sizing: border-box;
  
  margin: 0;
}

.container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  
  width: 100vw;
  height: 100vh;
  
  background: #68D0DF;
}

.white-box {
  position: relative;
  
  width: 160px;
  height: 80px;
  
  background: white;
}

.circle {
  position: absolute;
  top: -20px;
  left: -20px;
  
  width: 40px;
  height: 40px;

  border-radius: 100%;
  
  background: #9A5DCB;
}

.square {
  position: absolute;
  top: -20px;
  left: 80px;

  width: 80px;
  height: 40px;

  background: #9A5DCB;
}

.flipped {
  transform: rotate(180deg);
}

0개의 댓글