유튜브 왼쪽 nav, content 부분 전부
github
inline-block
혹은 block
으로 변경하니 잘 인식하는 것으로 보아 button의 기본 display가 inline이라 생기는 문제인 듯 하다.#youtube-left-content .nav-section .nav-body .txt-wrap .btn-login {
display: inline-block;
border: solid 1px #3ea6ff;
border-radius: 2px;
padding: 10px 12px;
margin-top: 12px;
font-size: 14px;
color: #3ea6ff;
}
word-break: keep-=all
속성을 추가해주었다. #youtube-left-content #youtube-footer .txt-wrap a {
margin-right: 8px;
word-break: keep-all;
color: #aaa;
font-weight: 500;
}
위 캡처는 실제 유튜브 메인 페이지 모습인데, 강의에서 다루지 않았던 태그 목록과 배너 부분이 있어 그 부분도 추가로 만들어보기로 했다.
width
대신 max-width
를 사용했다.#youtube-main .tag-wrap li {
max-width: 170px;
margin: 12px;
margin-left: 0;
padding: 3px 10px;
border: solid 1px #4a4a4a;
border-radius: 20px;
background-color: #373737;
}
#youtube-main .tag-wrap a {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
display: inline-block;
width: 100%;
font-size: 12px;
font-weight: 400;
}
#youtube-main .tag-wrap li.on {
background-color: #ffffff;
color: #030303;
}
#youtube-main .tag-wrap li.on a {
color: #030303;
}
#youtube-main .youtube-banner .btn-close {
position: absolute;
width: 24px;
height: 24px;
background-color: black;
top: 16px;
right: 16px;
}
#youtube-main .youtube-banner .txt-wrap .btn-join {
display: inline-block;
border: solid 2px #065fd4;
border-radius: 2px;
padding: 10px 12px;
margin-top: 130px;
font-size: 14px;
color: #065fd4;
}
<div class="video-section">
<div class="video-section-title-wrap">
<h2>코로나19 감염증 및 백신 관련 정보</h2>
</div>
<ul class="video-lists flex-between">
<li>
<!-- 영상링크 / 채널 링크 분기처리 -->
<div class="video-thumbnail">
<a href="#">
<img src="" alt="">
<span class="time">5:44</span>
</a>
</div>
<div class="video-txt-wrap flex-start">
<a class="img-link" href="#">
<img class="profile" src="" alt="">
</a>
<div class="txt">
<h3><a class="title-link" href="#">"[무도]</a></h3>
<p><a class="channel-link" href="#">옛능...</a></p>
<div class="txt-bottom">
<span class="count">조회수 10만회</span>
<span class="date">20시간 전</span>
</div>
</div>
</div>
</li>
</ul>
</div>
#youtube-main-content .video-section {
width: 100%;
border-bottom: solid 4px rgba(255, 255, 255, 0.1);
background-color: #181818;
margin: 20px 0;
}
#youtube-main-content .video-section .video-section-title-wrap {
margin: 0 0 20px 4px;
font-size: 13px;
font-weight: 400;
}
#youtube-main-content li {
width: 24%;
margin-bottom: 40px;
}
#youtube-main-content li .video-txt-wrap .txt h3 .title-link {
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
white-space: normal;
max-width: 100%;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
#youtube-main-content li .video-txt-wrap .txt .txt-bottom .count::after {
content: "";
display: inline-block;
width: 2px;
height: 2px;
background-color: #aaa;
vertical-align: -1px;
margin: 0 0 3px 3px;
}
오늘 영상 길이 자체는 1시간으로 짧았지만 강의에서 다루지 않은 태그 목록이나 배너 등도 추가하고, 오류인지 영상 뒷부분이 잘려서 비디오 목록 부분도 혼자서 만들었더니 평소보다 더 많이 배웠다.