HTML 문서
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>네이버</title>
<link rel="stylesheet" type="text/css" href="css/style1.css">
</head>
CSS 문서
/* Default CSS */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
ol, ul {
list-style: none;
}
a {
text-decoration: none;
color: #000000;
}
img {
vertical-align: middle;
}
button {
border: none;
}
input, textarea {
outline: none;
}
.clearfix {
clear: both;
}
.container {
width: 1130px;
margin: 0 auto;
}
.esport-flex-start {
display: flex;
flex-wrap: wrap;
align-items: center;
}
.esport-flex-center {
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
}
.esport-flex-end {
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
align-items: center;
}
.esport-flex-between {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
}
.esport-container {
width: 1280px;
margin: 0 auto;
}
메인 상단 영역을 추가하여, 전 사이트를 참고하여 배너를 넣었음
float
속성을 사용하여 3등분 영역을 만들 수 있음. 부모 태그를 만들고, 가장 큰 영역에 height: 100%
값을 설정하고, 나머지 태그들을 차례대로 만들면 다음과 같은 영역이 나옴
height
, max-height
속성으로 높이 설정
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
max-height: 57px;
right-lists
영역에 class
를 추가(bold
)하여 4줄만 굵기를 적용하였음HTML 문서
<body>
<main id="esport-main" role="main">
<div class="esport-container">
<div class="content-wrap">
<div class="top">
<div class="top-banner game-shadow">
<a href="#">
<img src="https://via.placeholder.com/1280x156">
</a>
</div>
</div>
<div class="left">
<div id="esport-main-article">
<div class="article full">
<img src="https://via.placeholder.com/150">
<div class="txt-wrap">
<h3>Title Title Title Title Title Title Title Title Title Title</h3>
<p>동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록</p>
<span class="source">엑스포츠뉴스</span>
</div>
</div>
<div class="article">
<img src="https://via.placeholder.com/150">
<div class="txt-wrap">
<h3>Title Title Title Title Title Title Title Title Title Title</h3>
<span class="source">엑스포츠뉴스</span>
</div>
</div>
<div class="article">
<img src="https://via.placeholder.com/150">
<div class="txt-wrap">
<h3>Title Title Title Title Title Title Title Title Title Title</h3>
<span class="source">엑스포츠뉴스</span>
</div>
</div>
</div>
<div id="esport-replay" class="esport-section">
<div class="title-wrap">
<h2>경기 다시보기</h2>
</div>
<nav class="game-menu">
<ul class="esport-flex-start">
<li>
<a href="#" class="active">
<i></i>
<span>LCK</span>
</a>
</li>
<li>
<a href="#">
<i></i>
<span>LCK CL</span>
</a>
</li>
<li>
<a href="#">
<i></i>
<span>GSL</span>
</a>
</li>
<li>
<a href="#">
<i></i>
<span>PWS</span>
</a>
</li>
<li>
<a href="#">
<i></i>
<span>BSC</span>
</a>
</li>
<li>
<a href="#">
<i></i>
<span>MSI</span>
</a>
</li>
<li>
<a href="#">
<i></i>
<span>롤드컵</span>
</a>
</li>
</ul>
</nav>
<ul class="play-lists esport-flex-between">
<li>
<a href="#">
<div class="image-wrap">
<img src="https://via.placeholder.com/285x160">
<div class="status-wrap esport-flex-between">
<i></i>
<span class="time">1:08:44</span>
</div>
</div>
<h3>SUNDAY NIGHT LCK 8화</h3>
</a>
</li>
<li>
<a href="#">
<div class="image-wrap">
<img src="https://via.placeholder.com/285x160">
<div class="status-wrap esport-flex-between">
<i></i>
<span class="time">1:08:44</span>
</div>
</div>
<h3>SUNDAY NIGHT LCK 8화</h3>
</a>
</li>
<li>
<a href="#">
<div class="image-wrap">
<img src="https://via.placeholder.com/285x160">
<div class="status-wrap esport-flex-between">
<i></i>
<span class="time">1:08:44</span>
</div>
</div>
<h3>SUNDAY NIGHT LCK 8화</h3>
</a>
</li>
<li>
<a href="#">
<div class="image-wrap">
<img src="https://via.placeholder.com/285x160">
<div class="status-wrap esport-flex-between">
<i></i>
<span class="time">1:08:44</span>
</div>
</div>
<h3>SUNDAY NIGHT LCK 8화</h3>
</a>
</li>
<li>
<a href="#">
<div class="image-wrap">
<img src="https://via.placeholder.com/285x160">
<div class="status-wrap esport-flex-between">
<i></i>
<span class="time">1:08:44</span>
</div>
</div>
<h3>SUNDAY NIGHT LCK 8화</h3>
</a>
</li>
<li>
<a href="#">
<div class="image-wrap">
<img src="https://via.placeholder.com/285x160">
<div class="status-wrap esport-flex-between">
<i></i>
<span class="time">1:08:44</span>
</div>
</div>
<h3>SUNDAY NIGHT LCK 8화</h3>
</a>
</li>
</ul>
</div>
<div id="esport-news" class="esport-section">
<div class="title-wrap">
<h2>추천 뉴스</h2>
</div>
<div class="article-wrap esport-flex-between">
<ul class="left-lists esport-flex-between">
<li>
<a href="#">
<img src="https://via.placeholder.com/226x132">
<h3>title title title title title</h3>
<p>동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록</p>
</a>
</li>
<li>
<a href="#">
<img src="https://via.placeholder.com/226x132">
<h3>title title title title title</h3>
<p>동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록</p>
</a>
</li>
</ul>
<ul class="right-lists">
<li><a href="#" class="bold">동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록</a></li>
<li><a href="#" class="bold">동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록</a></li>
<li><a href="#" class="bold">동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록</a></li>
<li><a href="#" class="bold">동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록</a></li>
<li><a href="#">동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록</a></li>
<li><a href="#">동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록</a></li>
<li><a href="#">동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록</a></li>
<li><a href="#">동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록</a></li>
</ul>
</div>
</div>
<div id="esport-expert" class="esport-section">
<div class="title-wrap">
<h2>전문가 칼럼</h2>
</div>
<ul class="news-lists esport-flex-between">
<li>
<a href="#" class="esport-flex-start">
<img src="https://via.placeholder.com/153x86">
<div class="txt-wrap">
<h3>Title</h3>
<p>동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 </p>
<span class="source">Team LoL 핫매치 리뷰 / 프리뷰 · 인벤</span>
</div>
</a>
</li>
<li>
<a href="#" class="esport-flex-start">
<img src="https://via.placeholder.com/153x86">
<div class="txt-wrap">
<h3>Title</h3>
<p>동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 </p>
<span class="source">Team LoL 핫매치 리뷰 / 프리뷰 · 인벤</span>
</div>
</a>
</li>
<li>
<a href="#" class="esport-flex-start">
<img src="https://via.placeholder.com/153x86">
<div class="txt-wrap">
<h3>Title</h3>
<p>동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 </p>
<span class="source">Team LoL 핫매치 리뷰 / 프리뷰 · 인벤</span>
</div>
</a>
</li>
<li>
<a href="#" class="esport-flex-start">
<img src="https://via.placeholder.com/153x86">
<div class="txt-wrap">
<h3>Title</h3>
<p>동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 동해물과 백두산이 마르고 닳도록 </p>
<span class="source">Team LoL 핫매치 리뷰 / 프리뷰 · 인벤</span>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</main>
</body>
CSS 문서 1 - style.css
#esport-main .left {
float: left;
width: 900px;
/*height: 2000px;*/
/*background-color: yellow;*/
}
#esport-main-article {
overflow: hidden;
width: 100%;
height: 468px;
background-color: grey;
border-radius: 10px;
margin-bottom: 30px;
}
#esport-main-article .article {
position: relative;
float: left;
width: 50%;
height: 50%;
}
#esport-main-article .article.full {
height: 100%;
}
#esport-main-article .article img {
position: absolute;
width: 100%;
height: 100%;
}
#esport-main-article .article .txt-wrap {
position: absolute;
width: 100%;
padding: 0 24px 20px;
left: 0;
bottom: 0;
color: #ffffff;
}
#esport-main-article .article .txt-wrap h3 {
font-size: 20px;
font-weight: 700;
line-height: 26px;
}
#esport-main-article .article .txt-wrap p {
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
max-height: 57px;
margin-top: 5px;
font-size: 14px;
font-weight: 500;
line-height: 19px;
}
#esport-main-article .article .txt-wrap .source {
display: block;
margin-top: 10px;
font-size: 13px;
color: hsla(0, 0, 100%, .7);
}
.esport-section {
border-top: solid 1px grey;
padding-bottom: 30px;
margin-bottom: 30px;
}
.esport-section .title-wrap {
padding: 15px 0;
}
.esport-section .title-wrap h2 {
font-size: 18px;
}
#esport-replay .game-menu {
margin-bottom: 24px;
}
#esport-replay .game-menu ul li {
margin-right: 20px;
}
#esport-replay .game-menu ul li:last-child {
margin-right: 0;
}
#esport-replay .game-menu ul li a {
display: block;
width: 60px;
/*height: 82px;*/
text-align: center;
}
#esport-replay .game-menu ul li a.active i {
background-color: #4E41DB;
}
#esport-replay .game-menu ul li a.active span{
color: purple;
}
#esport-replay .game-menu ul li i {
display: inline-block;
width: 60px;
height: 60px;
background-color: grey;
border-radius: 50%;
margin-bottom: 6px;
}
#esport-replay .game-menu ul li span{
font-size: 13px;
}
#esport-replay .play-lists li {
width: 285px;
margin-bottom: 24px;
}
#esport-replay .play-lists li:nth-child(4),
#esport-replay .play-lists li:nth-child(5),
#esport-replay .play-lists li:nth-child(6) {
margin-bottom: 0;
}
#esport-replay .play-lists li a {
display: block;
}
#esport-replay .play-lists li .image-wrap {
position: relative;
width: 100%;
height: 160px;
margin-bottom: 11px;
}
#esport-replay .play-lists li .image-wrap img {
position: absolute;
width: 100%;
height: 100%;
}
#esport-replay .play-lists li .image-wrap .status-wrap {
position: absolute;
width: 100%;
left: 0;
bottom: 0;
padding: 10px;
}
#esport-replay .play-lists li .image-wrap .status-wrap i {
display: block;
width: 20px;
height: 20px;
background-color: grey;
}
#esport-replay .play-lists li .image-wrap .status-wrap .time {
background-color: rgba(0, 0, 0, 0.7);
padding: 3px 5px;
border-radius: 3px;
font-size: 11px;
color: #ffffff;
}
#esport-replay .play-lists li h3 {
font-size: 15px;
}
#esport-news .article-wrap {
align-items: flex-start;
}
#esport-news .article-wrap .left-lists {
width: 472px;
}
#esport-news .article-wrap .left-lists li {
width: 226px;
}
#esport-news .article-wrap .left-lists li a {
display: block;
}
#esport-news .article-wrap .left-lists img {
width: 100%;
height: 132px;
margin-bottom: 9px;
}
#esport-news .article-wrap .left-lists h3 {
font-size: 16px;
font-weight: 500;
line-height: 21px;
}
#esport-news .article-wrap .left-lists p {
font-size: 14px;
color: #777;
}
#esport-news .article-wrap .right-lists {
width: 400px;
}
#esport-news .article-wrap .right-lists .bold {
font-weight: bold;
}
#esport-news .article-wrap .right-lists li {
position: relative;
margin-bottom: 5px;
}
#esport-news .article-wrap .right-lists li:before {
position: absolute;
display: inline-block;
content: '';
width: 4px;
height: 4px;
background-color: grey;
border-radius: 50%;
top: 6px;
}
#esport-news .article-wrap .right-lists li a {
display: block;
font-size: 16px;
padding-left: 15px;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
#esport-expert .news-lists li {
width: 450px;
margin-bottom: 15px;
}
#esport-expert .news-lists li img {
width: 153px;
height: 86px;
margin-right: 15px;
}
#esport-expert .news-lists .txt-wrap {
width: 268px;
}
#esport-expert .news-lists .txt-wrap h3 {
font-size: 15px;
font-weight: 500;
}
#esport-expert .news-lists .txt-wrap p {
font-size: 14px;
color: #777777;
line-height: 19px;
margin-top: 4px;
display: -webkit-box;
overflow: hidden;
max-height: 38px;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
text-overflow: ellipsis;
}
#esport-expert .news-lists .txt-wrap .source {
font-size: 13px;
color: #777777;
}
display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
속성을 배웠음.