학습 내용
html
<main role="main" id="game-main">
<div class="game-container game-flex-between">
<div class="left">
<div class="left-banner game-shadow">
<a href="#">
<img src="https://via.placeholder.com/900x120">
</a>
</div>
</div>
css
#game-main .left .left-banner {
overflow: hidden;
width: 900px;
height: 120px;
border-radius: 12px;
margin-bottom: 24px;
}
#game-main .left .left-banner a {
display: block;
width: 100%;
height: 100%;
}
#game-main .left .left-banner img {
width: 100%;
height: 100%;
}
어려웠던 점
오늘 강의를 들으려고 하니 저번 시간에 아래부분을 작성하면서 공백없이 붙여져 있는 것을 확인했다.
해결 방법
지난 강의를 다시 들어봐도 다른 부분이 없는 것 같아서#game-main .game-conter { margin-top: 24px; }
을 추가해주었다.
html
<div id="game-section-1" class="game-section">
<div class="section-title-wrap">
<h2 class="font-19">게임 라운지 인기 글</h2>
<div class="section-btn-wrap">
<a href="#" class="active">전체</a>
<a href="#">Joined</a>
</div>
</div>
<nav class="section-middle-nav">
<ul>
<li><a href="#" class="active">공략+</a></li>
<li><a href="#">커뮤니티</a></li>
</ul>
</nav>
<ol>
<li>
<a href="#" class="game-flex-start">
<img src="https://via.placeholder.com/38" class="game-thumbnail">
<div class="txt-info">
<h3>롤 패치</h3>
<div class="source-wrap">
<span class="game">리그 오브 레전드</span>
<span class="author">이정민</span>
<span class="level">Lv8</span>
<span class="rank">3</span>
</div>
</div>
<img src="https://via.placeholder.com/90x50" class="blog-thumbnail">
</a>
</li>
</ol>
css
.game-section {
position: relative;
background-color: #ffffff;
box-shadow: 0 2px 30px 0 rgb(0 0 0 / 6%);
border-radius: 12px;
padding: 27px 30px 40px;
}
.game-section .section-title-wrap {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
}
.game-section .section-title-wrap h2 {
font-size: 19px;
font-weight: 400;
}
.game-section .section-middle-nav ul {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
align-items: center;
border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}
.game-section .section-middle-nav a {
display: block;
padding: 14px;
border-bottom: solid 3px transparent;
color: #777;
}
.game-section .section-middle-nav a.active {
border-bottom: solid 3px #7776ff;
font-weight: 700;
color: #7776ff;
}
#game-section-1 .section-btn-wrap a {
font-size: 14px;
color: #9da5b6;
font-weight: 700;
}
#game-section-1 .section-btn-wrap a.active {
color: #7776ff;
}
#game-section-1 .section-btn-wrap a:last-child {
margin-left: 14px;
}
#game-section-1 ol li {
padding: 10px 0;
border-bottom: solid 1px rgba(0, 0, 0, .03);
}
#game-section-1 ol li .game-thumbnail {
border-radius: 8px;
margin-right: 10px;
}
#game-section-1 ol li .txt-info {
width: 690px;
margin-right: 10px;
}
#game-section-1 ol li .txt-info h3 {
font-size: 16px;
font-weight: 600;
margin-bottom: 3px;
}
#game-section-1 ol li .txt-info .source-wrap .game {
font-size: 13px;
color: #858894;
margin-right: 5px;
}
#game-section-1 ol li .txt-info .source-wrap .author {
font-size: 13px;
color: #858894;
margin-right: 5px;
}
#game-section-1 ol li .txt-info .source-wrap .level {
font-size: 13px;
color: #858894;
margin-right: 5px;
}
#game-section-1 ol li .txt-info .source-wrap .rank {
font-size: 13px;
color: #858894;
}
#game-section-1 ol li .blog-thumbnail {
border-radius: 8px;
}
html
<a href="#" class="btn-circle icon-arrow"></a>
css
.game-section .btn-circle {
position: absolute;
width: 55px;
height: 55px;
background-color: #ffffff;
border-radius: 50%;
box-shadow: 0 2px 30px 0 rgb(0 0 0 / 6%);
bottom: -27.5px;
left: 50%;
transform: translateX(-50%);
}
.game-section .btn-circle.icon-arrow {
background-color: grey;
}
css
.game-section {
margin-bottom: 40px;
}
class와 id 둘 다 주었을 때 id로 적용이 된다.
학습 소감
css로 미리 적용해둔 것을 html 작성할 때 적용해본 것은 처음이었다. 연결이 되있는만큼 잘 사용하면 좋을 것 같다.