네이버 게임 main-right, footer
github소스코드
right-secton
등의 클래스명을 사용해 게임 페이지 오른쪽에 들어갈 영역의 default 클래스를 만들어주었다. 다른 페이지에도 비슷한 이름을 사용한다면 추가로 game 클래스 등을 적어주어서 .game.right-section
이런 식으로 설정할 수도 있을 것 같다..right-section {
box-shadow: 0 2px 30px 0 rgb(0 0 0 / 6%);
border-radius: 12px;
padding: 30px;
background-color: #ffffff;
margin-bottom: 24px;
}
.right-section .title-wrap h2 {
font-size: 17px;
font-weight: 700;
}
.right-section .title-wrap a {
font-size: 13px;
font-weight: 400;
color: #444;
}
.right-section .right-section-body {
margin-top: 20px;
}
input-wrap
중앙정렬 방법 두 가지 시도해보았고 둘 다 중앙정렬되었다.margin: 0 auto
align-item
으로 센터 정렬<div class="input-wrap flex-start">
<input type="text" placeholder="라운지 검색">
<button type="button"></button>
</div>
#visitor-section .text-wrap .input-wrap {
position: relative;
overflow: hidden;
width: 250px;
height: 44px;
background-color: #f5f6fa;
border-radius: 12px;
margin-top: 18px;
/* margin: 18px auto 0 auto; */
}
border:none
하면 focus 되었을 때 outline
효과도 같이 사라짐#visitor-section .text-wrap .input-wrap input {
width: calc(100% - 44px);
height: 100%;
padding: 10px 16px;
background-color: transparent;
border: none;
font-size: 15px;
}
/* #visitor-section .text-wrap .input-wrap input:focus {
outline: none;
} */
#visitor-section .text-wrap .input-wrap button {
width: 44px;
height: 100%;
background-color: transparent;
background-image: url(../img/search.png);
background-repeat: no-repeat;
background-size: 24px;
background-position: center;
}
<a href="#">
<div class="count-wrap">
<span class="count">1</span>
<div class="up-down-wrap">
<div class="equal"></div>
</div>
</div>
<div class="img-wrap">
</div>
<div class="txt-wrap">
</a>
...
<a href="#">
<div class="count-wrap">
<span class="count">4</span>
<div class="up-down-wrap">
<span class="up">1</span>
</div>
</div>
</a>
.rank-section .right-section-body li a {
display: flex;
flex-wrap: wrap;
align-items: center;
}
.rank-section .right-section-body li .count-wrap {
position: relative;
width: 25px;
/* text-align: center; */
}
.rank-section .right-section-body li .count-wrap .up-down-wrap {
position: absolute;
bottom: -13px;
}
/* position 변경없이 margin, padding으로 움직이려 하니 위치 변동 없었음
마진병합인지 아니면 position때문에 위치변경이 안된건지
*/
position:absolute
를 주어 flex 영향에서 벗어나게 만들었음position:relative
를 주고 top
으로 이동했음..rank-section .right-section-body li .count-wrap .up-down-wrap .equal {
display: inline-block;
width: 5px;
height: 3px;
background-color: gray;
margin-left: 4px;
}
.rank-section .right-section-body li .count-wrap .up-down-wrap span {
position: relative;
display: inline-block;
top: 5px;
}
.rank-section .right-section-body li .count-wrap .up-down-wrap span::before {
content: "";
display: inline-block;
position: relative;
width: 7px;
height: 3px;
margin-right: 1px;
top: -3px;
}
overflow:hidden
을 이용해 영역의 border-radius
안에 내용물을 맞췄는데 아이콘이 잘려서 border-radius
속성을 이미지 자체로 옮겨주었음..rank-section .right-section-body li .img-wrap {
position: relative;
width: 55px;
height: 55px;
margin-right: 14px;
}
.rank-section .right-section-body li .img-wrap img {
position: absolute;
width: 100%;
height: 100%;
border-radius: 12px;
border: solid 1px rgba(0, 0, 0, 0.06);
}
.rank-section .right-section-body li .img-wrap .chk {
position: absolute;
display: inline-block;
width: 21px;
height: 21px;
background-color: #634ea4;
border-radius: 50px;
top: -4px;
right: -4px;
}
.rank-section .right-section-body li a::after {
content: "";
width: 14px;
height: 14px;
background: url(../img/next.png) no-repeat;
background-size: 10px;
}
<div class="game-banner">
<a href="#">
<img src="https://via.placeholder.com/357x200" alt="">
</a>
</div>
.right .game-banner a {
display: block;
overflow: hidden;
width: 100%;
height: 200px;
border-radius: 12px;
margin-bottom: 24px;
}
.right .game-banner a img {
width: 100%;
height: 100%;
}
inline-block
요소도 분명 margin, padding이 적용될텐데 span에 왜 적용이 안 되는지 잘 이해는 안 됐다. 그래도 position을 바꿔서 원하는 대로 이동시킬 수 있었다. 지금 생각해보면 그것도 div 안에 들어있는 요소이니 부모div를 이동시키봤어야 했나 싶다. 하지만 변동 상태에 따라 태그 종류가 다르기 때문에 결과적으론 옳은 방법을 택한 것 같다.오늘은 작은 요소들의 위치를 미세하게 조정할 일이 꽤 있었다. 스스로 엄청 세심한 스타일은 아니라고 생각하는데 웹프론트를 공부하다보니 점점 작은 부분까지도 신경을 쓰는 방향으로 변화하고 있는 것 같다.