네이버 게임 main-left 전부
github소스코드
btn-circle
클래스로 속성을 지정했다. left: 50%
+ transform: translateX(-50%)
.game-section .btn-circle {
position: absolute;
width: 55px;
height: 55px;
border-radius: 50%;
background-color: #fff;
box-shadow: 0 2px 30px 0 rgb(0 0 0 / 6%);
left: 50%;
transform: translateX(-50%);
bottom: -27.5px;
background-image: url(../img/plus.png);
background-repeat: no-repeat;
background-position: 17px 15px;
}
background-image
를 이용해 안에 들어가는 아이콘 모양만 바꾸어 주었다. background-image
와 그 관련 속성들 (background-repeat
등)이 같은 클래스에 있지 않아도 잘 적용될지 긴가민가했는데 해보니 잘 됐다..game-section .btn-circle.icon-arrow {
background-image: url(../img/expand-button.png);
}
.game-section .btn-circle.icon-plus {
background-image: url(../img/plus.png);
}
강의를 들을수록 공통 부분을 default 클래스로 만드는 비율이 늘어나고 있다. 기초부터 시작해서 효율적으로 응용하는 단계까지 순차적으로 배우고 있어서 마음에 든다.