๐Ÿ’›[๋ถ€์ŠคํŠธ์ฝ”์Šค_์›น UI ๊ฐœ๋ฐœ] 16. ์ด๋ฏธ์ง€ ๋ชฉ๋ก

๐Ÿ‘พยท2021๋…„ 1์›” 30์ผ
0

HTML & CSS

๋ชฉ๋ก ๋ณด๊ธฐ
16/20
post-custom-banner

์ด๋ฏธ์ง€ ๋ชฉ๋ก ์†Œ๊ฐœ

Image List๋ž€?

thumb nail List๋ผ๊ณ ๋„ ๋ถˆ๋ฆฐ๋‹ค
์„ฌ๋„ค์ผ์˜ ์‚ฌ์ „์  ์˜๋ฏธ : ์—„์ง€์†ํ†ฑ, ์ž‘์€ ๋ฌผ๊ฑด

์ธํ„ฐ๋„ท์—์„œ๋Š” ์ž‘์€ ํฌ๊ธฐ์˜ ๊ฒฌ๋ณธ ์ด๋ฏธ์ง€๋ฅผ ๊ฐ€๋ฅด์ผœ ์„ฌ๋„ค์ผ์ด๋ผ๊ณ  ๋ถ€๋ฅธ๋‹ค.

์‚ฌ์šฉ ์˜ˆ์‹œ

  • ๋„ค์ด๋ฒ„ ๋ฉ”์ธํ™”๋ฉด
  • ๋„ค์ด๋ฒ„ ์˜ํ™” ์‚ฌ์ดํŠธ
  • ๋„ค์ด๋ฒ„ TV ์‚ฌ์ดํŠธ

์ด๋ฏธ์ง€ ๋ฆฌ์ŠคํŠธ๋Š” ์›น์‚ฌ์ดํŠธ์—์„œ ํ”ํžˆ ์‚ฌ์šฉ๋˜๊ณ  ์žˆ๋Š” UI์ค‘์˜ ํ•˜๋‚˜์ด๋‹ค.


์ด๋ฏธ์ง€ ๋ชฉ๋ก ์ œ์ž‘

๊ฐ„๋‹จํ•œ ์ด๋ฏธ์ง€ ๋ฆฌ์ŠคํŠธ ๋งŒ๋“ค๊ธฐ

๊ตฌ์„ฑ

  • ๋ฉ”์ธ์€ 3๋‹จ ์ด๋ฏธ์ง€ ํ˜•ํƒœ
  • ์„œ๋ธŒ๋Š” 5๋‹จ

์‹ค๋ฌด์—์„œ ๋งˆํฌ์—…ํ• ๋•Œ๋Š” ๋ณดํ†ต ๋””์ž์ธ์„ ๋ฐ›์•„์„œ ์ž‘์—… ์ง„ํ–‰ํ•จ. ๊ทธ๋ž˜์„œ UI ๊ฐ€์ด๋“œ์— ๋Œ€ํ•œ ์ดํ•ด๊ฐ€ ๋งŽ์ด ํ•„์š”

UI ๊ฐ€์ด๋“œ ์ดํ•ดํ•˜๊ธฐ

๋ ˆ์ด์•„์›ƒ

  • ์ด๋ฏธ์ง€ ๋ฆฌ์ŠคํŠธ ์ „์ฒด์˜ ์ปจํ…์ธ  : 1000px ๋„ˆ๋น„
    ์ด ์ปจํ…์ธ ๋Š” ๋ธŒ๋ผ์šฐ์ € ๋„ˆ๋น„๊ฐ€ 1000px๋ฅผ ๋„˜์–ด๊ฐˆ๊ฒฝ์šฐ ์ค‘์•™์ •๋ ฌ ์ฒ˜๋ฆฌ
    -> ์šฐ์ธก ์—ฌ๋ฐฑ = ์ขŒ์ธก ์—ฌ๋ฐฑ

๋ฉ”์ธ ์ด๋ฏธ์ง€ ๋ฆฌ์ŠคํŠธ

  • ์ด๋ฏธ์ง€ ๋ฆฌ์ŠคํŠธ๋ฅผ ๊ฐ์‹ธ๋Š” ๋ฐ•์Šค์˜ ๋ฐฐ๊ฒฝ์ƒ‰
  • ์ด๋ฏธ์ง€ ์‚ฌ์ด์ฆˆ
  • ์ด๋ฏธ์ง€ ์‚ฌ์ด์˜ ๊ฐ„๊ฒฉ
  • ์‚ฌ์šฉ๋˜๋Š” ํ…์ŠคํŠธ์— ๋”ฐ๋ฅธ ํฐํŠธ ์‚ฌ์ด์ฆˆ์™€ ์ปฌ๋Ÿฌ
  • ๋ง์ค„์ž„ ์ฒ˜๋ฆฌ
  • ์„ฌ๋„ค์ผ์„ ๊ฐ์‹ธ๋Š” ์™ธ๊ณฝ์„ 
  • ์ด๋ฏธ์ง€ ์œ„์— ํฐ ํ…์ŠคํŠธ๊ฐ€ ์ž˜ ๋ณด์ผ ์ˆ˜ ์žˆ๋„๋ก dim์ฒ˜๋ฆฌ๋œ ๋ฐฐ๊ฒฝ ๊น”๋ ค์•ผํ•จ

์„œ๋ธŒ ์ด๋ฏธ์ง€ ๋ฆฌ์ŠคํŠธ

  • ์„ฌ๋„ค์ผ ์™ธ๊ณฝ์„ 
  • ์ด๋ฏธ์ง€ ์‚ฌ์ด ๊ฐ„๊ฒฉ
  • ์ด๋ฏธ์ง€ ๋ฆฌ์ŠคํŠธ์˜ ์ƒ, ํ•˜์˜ ๊ฐ„๊ฒฉ
  • ์ด๋ฏธ์ง€ ์‚ฌ์ด์ฆˆ
  • ํ…์ŠคํŠธ ํƒ€์ดํ‹€ ๋‘ ์ค„ ๋ง์ค„์ž„
  • ์นดํ…Œ๊ณ ๋ฆฌ ์ •๋ณด ํ•œ ์ค„ ๋ง์ค„์ž„

์ฃผ์š” ํƒœ๊ทธ ๋ฐ ์Šคํƒ€์ผ

  • HTML
    div, img, a, ol
  • CSS
    float, position, ellipsis, :after, :nth-child

1. ์ด๋ฏธ์ง€ ๋ฆฌ์ŠคํŠธ ์ •๋ ฌ

<div class="main_wrap">
  <ol class="main_list">
    <li>90x90</li>
    <li>90x90</li>
    <li>90x90</li>
  </ol>
</div>
<ol class="sub_list">
  <li>48x48</li>
  <li>48x48</li>
  <li>48x48</li>
  <li>48x48</li>
  <li>48x48</li>
  <li>48x48</li>
  <li>48x48</li>
  <li>48x48</li>
  <li>48x48</li>
  <li>48x48</li>  
</ol>

div: ๋ฉ”์ธ ๋ฆฌ์ŠคํŠธ ๋ฐ–์— ์žˆ๋Š” background color๋ฅผ ์ฃผ๊ธฐ ์œ„ํ•ด์„œ ๊ฐ์Œˆ

html, body, ol { /*reset css*/
  margin:0;
  padding:0;
}
ol {
  list-style: none; /*์Šคํƒ€์ผ ์ดˆ๊ธฐํ™”*/
  font-size: 12px;
  line-height: 14px;
  text-align: center;
}
.main_wrap {
  background-color: silver;
}
.main_list {
  width: 300px;
  margin: 0 auto; /*๊ฐ€์šด๋ฐ ์ •๋ ฌ*/
  padding: 20px 0; /*์ƒํ•˜๋‹จ ์—ฌ๋ฐฑ*/
}
.main_list li {
  float: left; /*๋ธ”๋ก ์š”์†Œ๋ฅผ ์ขŒ์ธก์œผ๋กœ ์ด์–ด๋ถ™์ด๊ฒŒ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋‹ค*/
  /*float์„ ์„ ์–ธํ–ˆ์„ ๊ฒฝ์šฐ ๋ถ€๋ชจ ์š”์†Œ๊ฐ€ ์ž์‹์˜ ๋†’์ด๊ฐ’์„ ์•Œ์ง€ ๋ชปํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋ฐ˜๋“œ์‹œ ํ•ด์ œํ•ด์•ผํ•œ๋‹ค*/
  width: 90px;
  height: 90px;  
  line-height: 90px;
  background-color: pink;
}

/*float ํ•ด์ œ*/
.main_list:after { 
  display: block;
  content: '';
  clear: both;
}

/*list ์‚ฌ์ด ๊ฐ„๊ฒฉ
2,3๋ฒˆ์งธ๋งŒ ์—ฌ๋ฐฑ ์ฃผ๊ธฐ ์œ„ํ•ด ํ˜•์ œ์„ ํƒ์ž๋กœ ์„ ์–ธ*/
.main_list li + li {
  margin-left: 15px;
}

.sub_list {
  width: 300px;
  margin: 0 auto;
  padding: 20px 0;
}
.sub_list li {
  float: left;
  width: 48px;
  height: 48px;
  margin-right: 15px;
  margin-bottom: 15px;
  line-height: 48px;
  background-color: olive;
}
.sub_list:after {
  display: block;
  content: '';
  clear: both;
}

/*๋งจ ๋งˆ์ง€๋ง‰ ์š”์†Œ์˜ ์šฐ์ธก ์—ฌ๋ฐฑ ์ดˆ๊ธฐํ™”
ํ•œ ์ค„์˜ 5๋ฒˆ์งธ ์š”์†Œ๋Š” ์šฐ์ธก ์—ฌ๋ฐฑ์„ ๊ฐ€์ง€๋ฉด ์•ˆ๋จ*/
.sub_list li:nth-child(5n) {
  margin-right: 0;
}

nth-child ์„ ํƒ์ž -> an+b ํ˜•ํƒœ๋กœ ๊ฐ’ ๋„ฃ์–ด์ค„ ์ˆ˜ ์žˆ์Œ.


2. ํ…์ŠคํŠธ ๋ง์ค„์ž„

<p class="elip1">๊ฐ€๋‚˜๋‹ค๋ผ๋งˆ๋ฐ”์‚ฌ์•„์ž์ฐจ์นดํƒ€ํŒŒํ•˜๊ฐ€๋‚˜๋‹ค๋ผ๋งˆ๋ฐ”์‚ฌ์•„์ž์ฐจ์นดํƒ€ํŒŒํ•˜๊ฐ€๋‚˜๋‹ค๋ผ๋งˆ๋ฐ”์‚ฌ์•„์ž์ฐจ์นดํƒ€ํŒŒํ•˜</p>
<p class="elip2">๊ฐ€๋‚˜๋‹ค๋ผ๋งˆ๋ฐ”์‚ฌ์•„์ž์ฐจ์นดํƒ€ํŒŒํ•˜๊ฐ€๋‚˜๋‹ค๋ผ๋งˆ๋ฐ”์‚ฌ์•„์ž์ฐจ์นดํƒ€ํŒŒํ•˜๊ฐ€๋‚˜๋‹ค๋ผ๋งˆ๋ฐ”์‚ฌ์•„์ž์ฐจ์นดํƒ€ํŒŒํ•˜</p>
<p class="elip3">๊ฐ€๋‚˜๋‹ค๋ผ๋งˆ๋ฐ”์‚ฌ์•„์ž์ฐจ์นดํƒ€ํŒŒํ•˜๊ฐ€๋‚˜๋‹ค๋ผ๋งˆ๋ฐ”์‚ฌ์•„์ž์ฐจ์นดํƒ€ํŒŒํ•˜๊ฐ€๋‚˜๋‹ค๋ผ๋งˆ๋ฐ”์‚ฌ์•„์ž์ฐจ์นดํƒ€ํŒŒํ•˜</p>
p {
  width: 200px; /*๋ง์ค„์ž„์„ ํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ๊ณ ์ • ๋„ˆ๋น„๋ฅผ ๊ฐ€์ ธ์•ผํ•จ*/
  background-color: yellow;
  font-size: 16px;
  line-height: 20px;
}

/*ํ•œ ์ค„ ๋ง์ค„์ž„*/
.elip1 {
  overflow: hidden; /*ํ…์ŠคํŠธ๊ฐ€ ๊ณ ์ • ๋„ˆ๋น„ ์˜์—ญ์„ ๋„˜์–ด๊ฐˆ ๊ฒฝ์šฐ ๋„˜์–ด๊ฐ€๋Š” ํ…์ŠคํŠธ๋ฅผ ๋ณด์ง€ ์•Š์Œ*/
  text-overflow: ellipsis; /*...ํ‘œ์‹œ ์ฒ˜๋ฆฌ*/
  white-space: nowrap;/*๋ธ”๋ก ์š”์†Œ์— ํ…์ŠคํŠธ๊ฐ€ ๋“ค์–ด๊ฐˆ ๊ฒฝ์šฐ ๋„ˆ๋น„๋ฅผ ๋„˜์–ด๊ฐ€๊ฒŒ ๋˜๋ฉด ์ž๋™ ์ค„๋ฐ”๊ฟˆ๋˜๋Š”๋ฐ ํ•œ ์ค„ ๋ง์ค„์ž„์€ ์ค„๋ฐ”๊ฟˆ ๋˜์ง€ ์•Š์•„์•ผ๋˜๋ฏ€๋กœ nowrap
  ์ค„๋ฐ”๊ฟˆ์ด ๋˜๋ฉด ๋ง์ค„์ž„์„ ํ•  ์ˆ˜ ์—†์œผ๋‹ˆ๊นŒ!*/
}

.elip2 {
  max-height: 40px; /* webkit ์™ธ ๋ธŒ๋ผ์šฐ์ € ๋Œ€์‘, line-height*line์ˆ˜. ํ…์ŠคํŠธ๊ฐ€ ๊ฐ–๊ณ  ์žˆ๋Š” ๋†’์ด๊ฐ’ */
  overflow: hidden;
  text-overflow: ellipsis;
  
  /*webkit ๊ณ„์—ด ๋ธŒ๋ผ์šฐ์ €์—์„œ ์—ฌ๋Ÿฌ ์ค„ ๋ง์ค„์ž„ ์ฒ˜๋ฆฌ๋ฅผ ์ ์šฉํ•˜๊ธฐ ์œ„ํ•œ ๋ถ€๋ถ„*/
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; /*๋ณด์—ฌ์ค„ ๋ผ์ธ ์ˆ˜*/ 
}

.elip3 {
  max-height: 60px; 
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
  • webkit ๊ณ„์—ด ๋ธŒ๋ผ์šฐ์ € -> ํฌ๋กฌ, ์˜คํŽ˜๋ผ, ์‚ฌํŒŒ๋ฆฌ ๋“ฑ

  • IE ๊ณ„์—ด(IE, ํŒŒ์ด์–ดํญ์Šค)์—์„œ๋Š” ๋™์ž‘ํ•˜์ง€ ์•Š๊ธฐ ๋–„๋ฌธ์— ๋ฐ˜๋“œ์‹œ height๊ฐ’์„ ์„ค์ •ํ•ด์ค˜์•ผํ•จ
    height๋ฅผ ์„ค์ •ํ•˜์ง€ ์•Š์œผ๋ฉด ์˜์—ญ์„ ๋ฒ—์–ด๋‚˜์„œ ์ค„๋ฐ”๊ฟˆ๋œ ํ…์ŠคํŠธ๊ฐ€ ๋ชจ๋‘ ๋…ธ์ถœ๋˜๊ฒŒ ๋œ๋‹ค.

  • ๋†’์ด๋ฅผ max-height๋กœ ์ž…๋ ฅํ•ด์„œ ๊ฐ€๋ณ€ ์ฒ˜๋ฆฌ๊ฐ€ ๋˜์–ด์„œ text๊ฐ€ ์งง์„๋•Œ์—๋Š” ํ•œ ์ค„ ๋†’์ด๊ฐ’๋งŒ ๊ฐ–๊ฒŒ๋จ


3. ์ด๋ฏธ์ง€ ์•ก์ž ํšจ๊ณผ

<div class="img_wrap">
  <img src="https://images.unsplash.com/photo-1544911845-1f34a3eb46b1?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80" width="200" height="134" alt="์ž„์‹œ ์ด๋ฏธ์ง€">
<div>

div : ์ด๋ฏธ์ง€ ์•ก์ž ํšจ๊ณผ๋ฅผ ๊พธ๋ฏธ๊ธฐ ์œ„ํ•ด ๋งŒ๋“  ๊ตฌ์กฐ

.img_wrap {
  position: relative; /*๊ฐ€์ƒ๊ตฌ์กฐ๊ฐ€ ์ด๋ฏธ์ง€ ์œ„๋กœ ์˜ฌ๋ผ์™€์•ผํ•จ*/
  width: 200px;
  height: 134px;
}

/*์ด๋ฏธ์ง€ ์œ„๋กœ ์™ธ๊ณฝ์„ ๊ณผ dimmed๋œ ๋ฐฑ๊ทธ๋ผ์šด๋“œ๊ฐ€ ๋“ค์–ด๊ฐˆ ์ˆ˜ ์žˆ๋„๋ก ๊ตฌ์กฐ๋ฅผ ํ•˜๋‚˜ ์ถ”๊ฐ€ํ•ด๋„ ๋˜์ง€๋งŒ ๋ถˆํ•„์š”ํ•œ ๊ตฌ์กฐ์ถ”๊ฐ€๋ฅผ ๋ง‰๊ธฐ ์œ„ํ•ด ๊ฐ€์ƒ ์„ ํƒ์ž ์ด์šฉ*/
.img_wrap:after {
  position: absolute; /*์ด๋ฏธ์ง€ ์œ„๋กœ ๋„์›Œ์ง€๊ฒŒ*/
  
  /*๋ถ€๋ชจ์˜ ๋„ˆ๋น„์™€ ๋†’์ด๊ฐ’ ๊ทธ๋Œ€๋กœ ๊ฐ€์ ธ์˜ด*/
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  
  content: '';
  border: 1px solid rgba(0, 0, 0, 0.3); /*์™ธ๊ณฝ์„ */
  background-color: rgba(0, 0, 0, 0.15);
  /*ํˆฌ๋ช…๊ฐ’ ์ž…๋ ฅ์œ„ํ•ด rgba ์‚ฌ์šฉ*/
}
  • postion์ด๋‚˜ display์†์„ฑ์ด ๋“ค์–ด๊ฐ€์•ผํ•˜๊ณ  content์— ๋นˆ๊ฐ’์ด ๋“ค์–ด๊ฐ€์•ผ์ง€ ๊ฐ€์ƒ๊ตฌ์กฐ๊ฐ€ ์ƒ์„ฑ๋œ๋‹ค

  • dimmed๋œ ๋ฐฑ๊ทธ๋ผ์šด๋“œ ์ปฌ๋Ÿฌ๋ฅผ ๊น”์•„์ฃผ๋Š” ์ด์œ ?
    ์ด๋ฏธ์ง€ ์œ„๋กœ ํฐ์ƒ‰ ํ…์ŠคํŠธ๊ฐ€ ์˜ฌ๋ผ๊ฐ€๊ฒŒ๋˜๋Š”๋ฐ, ๋ฐฐ๊ฒฝ์ด ํฐ์ƒ‰์ธ ์ด๋ฏธ์ง€๊ฐ€ ๋“ค์–ด์˜ฌ๊ฒฝ์šฐ ํ…์ŠคํŠธ๊ฐ€ ๋ฐฐ๊ฒฝ์— ๋ฌปํ˜€์„œ ์•Œ์•„๋ณด๊ธฐ ํž˜๋“ฆ
    ๋”ฐ๋ผ์„œ dimmed ์ฒ˜๋ฆฌ๋œ ๋ฐฐ๊ฒฝ์„ ๋จผ์ € ์ ์šฉํ•˜๊ณ  ๊ทธ ์œ„๋กœ ํฐ์ƒ‰ ํ…์ŠคํŠธ๋ฅผ ๋„ฃ์–ด์คฌ์„๋•Œ๋Š” ๊ฐ€๋…์„ฑ ๋ถ€๋ถ„์—์„œ ์ž˜ ์•Œ์•„๋ณผ ์ˆ˜ ์žˆ๋„๋ก ํ…์ŠคํŠธ๊ฐ€ ๋ณด์ด๊ฒŒ ๋˜๋ฏ€๋กœ ์‹ค๋ฌด์—์„œ ๊ต‰์žฅํžˆ ๋งŽ์ด ์“ฐ๋Š” ์†์„ฑ์ด๋‹ค.


๋ฉ”์ธ ๋ฆฌ์ŠคํŠธ ์ œ์ž‘

<!DOCTYPE html>
<html lang="ko">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
  	<!--์—๋ฆญ ๋งˆ์ด์–ด reset.css์ด์šฉํ•ด์„œ ์Šคํƒ€์ผ ์ดˆ๊ธฐํ™” -->
    <!-- http://meyerweb.com/eric/tools/css/reset/ -->
    <link rel="stylesheet" href="reset.css">
  	<!--์Šคํƒ€์ผ ์ ์šฉ-->
    <link rel="stylesheet" href="style_1.css">
    <title>๋„ค์ด๋ฒ„TV: ๊ฐ„๋‹จํ•œ ์ด๋ฏธ์ง€ ๋ฆฌ์ŠคํŠธ</title>
</head>
<body>
  <!--wrap div๋Š” ์ผ๋ฐ˜์ ์œผ๋กœ body๋ฐ‘์— ์˜ค๊ฒŒ๋จ. ๋ชจ๋“  ์ปจํ…์ธ ๋ฅผ ๊ฐ์‹ธ๋Š” ์š”์†Œ. wrap์€ ์Šคํƒ€์ผ์„ ์ ์šฉํ•˜์ง€ ์•Š๋”๋ผ๋„ ํ–ฅํ›„ ์–ด๋–ค ๋ ˆ์ด์•„์›ƒ์ด๋‚˜ ์ฝ”๋“œ์˜ ํ™•์žฅ์„ฑ์„ ์œ„ํ•ด์„œ ์ „์ฒด ์ปจํ…์ธ ๋ฅผ ๊ฐ์‹ธ๋Š” div๋ฅผ ๋งŒ๋“ค์–ด์ฃผ๋Š”๊ฒƒ์ด ์ข‹๋‹ค.-->
    <div class="wrap">
        <h1>TOP100</h1><!--ํƒ€์ดํ‹€-->
        <div class="main_wrap"><!--๋ฐฑ๊ทธ๋ผ์šด๋“œ-->
            <div class="content"><!--๋ฆฌ์ŠคํŠธ + ํ…์ŠคํŠธ-->
                <p class="noti_txt">8.21 ์˜ค์ „ 9์‹œ ~ ์˜ค์ „ 10์‹œ ๊ธฐ์ค€ (์žฌ์ƒ์ˆ˜, ์žฌ์ƒ์‹œ๊ฐ„, ์ข‹์•„์š”)</p>
                <ol class="main_list">
                    <li>
                        <a href="#" class="item_link">
                            <div class="img_box"><!--์ด๋ฏธ์ง€ ์™ธ๊ณฝ์„  ์ค„ ์ˆ˜ ์žˆ๋Š” ์ด๋ฏธ์ง€ ๋ฐ•์Šค-->
                                <img src="./img/thumb_image_large.jpg" alt="">
                            </div>
                            <div class="info">
                                <span class="category">์‚ฐ์•…์Šคํ‚ค</span>
                                <p class="title">์˜ค์ŠคํŠธ๋ฆฌ์•„ ์ตœ๋Œ€์˜ ์‚ฐ์•…์Šคํ‚ค ์—ฐ๋งน, ์‚ฐ์•…์Šคํ‚ค ์•„๋งˆ๋ฐ! 5๊ฐœ ์ง€์—ญ์— ๊ฑธ์ณ์žˆ๊ณ , ์ด 25์—ฌ๊ฐœ์˜ ์Šฌ๋กœํ”„ ๊ธธ์ด</p>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="#" class="item_link">
                            <div class="img_box">
                                <img src="./img/thumb_image_large.jpg" alt="">
                            </div>
                          <!--์ด๋ฏธ์ง€ ์œ„์˜ ํ…์ŠคํŠธ-->
                            <div class="info">
                                <span class="category">์‚ฐ์•…์Šคํ‚ค</span>
                                <p class="title">์˜ค์ŠคํŠธ๋ฆฌ์•„ ์ตœ๋Œ€์˜ ์‚ฐ์•…์Šคํ‚ค ์—ฐ๋งน, ์‚ฐ์•…์Šคํ‚ค ์•„๋งˆ๋ฐ! 5๊ฐœ ์ง€์—ญ์— ๊ฑธ์ณ์žˆ๊ณ , ์ด 25์—ฌ๊ฐœ์˜ ์Šฌ๋กœํ”„ ๊ธธ์ด</p>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="#" class="item_link">
                            <div class="img_box">
                                <img src="./img/thumb_image_large.jpg" alt="">
                            </div>
                            <div class="info">
                                <span class="category">์‚ฐ์•…์Šคํ‚ค</span>
                                <p class="title">์˜ค์ŠคํŠธ๋ฆฌ์•„ ์ตœ๋Œ€์˜ ์‚ฐ์•…์Šคํ‚ค ์—ฐ๋งน, ์‚ฐ์•…์Šคํ‚ค ์•„๋งˆ๋ฐ! 5๊ฐœ ์ง€์—ญ์— ๊ฑธ์ณ์žˆ๊ณ , ์ด 25์—ฌ๊ฐœ์˜ ์Šฌ๋กœํ”„ ๊ธธ์ด</p>
                            </div>
                        </a>
                    </li>
                </ol>
            </div>
        </div>
    </div>
</body>
</html>
@charset "UTF-8";

/* ๊ธฐ๋ณธ ์Šคํƒ€์ผ */
body {
    font-family: Dotum,'๋‹์›€', Helvetica, sans-serif;
    font-size: 15px;
    line-height: 18px;
    color: #3c3c3c;
}
a {
    color: inherit;
    text-decoration: none;
    vertical-align: top;
}
img {
    vertical-align: top;
}

/* ์Šคํƒ€์ผ ์„ ์–ธ */
h1 {
    overflow: hidden;
    width: 1000px; /*์ปจํ…์ธ ์™€ ํƒ€์ดํ‹€์ด ๊ฐ™์ด ๋ธŒ๋ผ์šฐ์ €์ƒ์—์„œ ์ค‘์•™ ์ •๋ ฌ๋ผ์•ผ ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์ปจํ…์ธ ๊ฐ€ ๊ฐ–๋Š” ๋„ˆ๋น„์™€ ๋™์ผํ•˜๊ฒŒ 1000px*/
    margin: 0 auto;
    padding: 20px 0;
    line-height: 38px;
    font-size: 26px;
     
    color: #000;
}
.main_wrap {
    background-color: #ececec;
}
.main_wrap .content {
    position: relative; 
    width: 1000px;
    margin: 0 auto;
    padding: 50px 0 20px;
}
.main_wrap .noti_txt {
	/*์šฐ์ธก ์ƒ๋‹จ์—์œ„์น˜*/
    position: absolute; /*๋ถ€๋ชจ์˜ ์ขŒํ‘œ๋ฅผ ๊ฐ€์ ธ์˜ค๊ธฐ ์œ„ํ•ด์„œ ๋ถ€๋ชจ์— position:relative ์†์„ฑ ์ž…๋ ฅ๋˜์•ผํ•จ(.content) */
    top: 20px;
    right: 0;
    
    font-size: 12px;
    color: #7c7c7c;
}

/*float ํ•ด์ œ*/
.main_list:after {
    display: block;
    content: '';
    clear: both;
}

.main_list li {
    float: left; /*๋ถ€๋ชจ๊ฐ€ ์ž์‹์˜ ๋†’์ด๊ฐ’์„ ์•Œ๊ฒŒ ํ•˜๋ ค๋ฉด float ํ•ด์ œ ํ•„์š”*/
}

/*2,3๋ฒˆ์งธ ์ด๋ฏธ์ง€ ์ขŒ์ธก๊ฐ„๊ฒฉ*/
.main_list li + li {
    margin-left: 17px;
}

.main_list li .item_link {
    position: relative; /*info์˜ ๋ถ€๋ชจ*/
    display: block; /*a๋Š” ์ธ๋ผ์ธ์š”์†Œ์ด๋ฏ€๋กœ ์˜์—ญ ์ œ๋Œ€๋กœ ์ธ์‹ํ•˜์ง€ ๋ชปํ•˜๋Š” ํ˜„์ƒ ๋ฐœ์ƒ. ๋”ฐ๋ผ์„œ ์ตœ๋Œ€ ์˜์—ญ์ด ๋งํฌ์š”์†Œ์ž„์„ ์ธ์ง€ํ•  ์ˆ˜ ์žˆ๋„๋ก display ์ด์šฉ*/
}

/*์•ก์ž ํšจ๊ณผ*/
.main_list .img_box {
    position: relative; /*๋ถ€๋ชจ*/
}
.main_list .img_box:after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    content: ''; /*๋นˆ๊ฐ’*/
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.main_list .img_box img { /*์ด๋ฏธ์ง€์˜ ์‚ฌ์ด์ฆˆ*/
    width: 322px;
    height: 215px;
}

/*์ด๋ฏธ์ง€ ์œ„ ํ…์ŠคํŠธ*/
.main_list .info {
    position: absolute; /*์ด๋ฏธ์ง€ ์œ„๋กœ ๋„์šฐ๊ธฐ ์œ„ํ•ด*/
    right: 15px;
    bottom: 15px;
    left: 15px;
    color: #fff;
    overflow: hidden; /*ํ™”๋ฉด ๋ฐ–์œผ๋กœ ๋„˜์น˜์ง€ ์•Š๊ฒŒ*/
}

/*๋ง์ค„์ž„*/
.main_list .category {
    font-size: 14px;
    line-height:18px; /*font-size ์ž…๋ ฅ์‹œ ๋ฐ˜๋“œ์‹œ line-height๋„ ์ž…๋ ฅํ•˜๋Š”๊ฒƒ์ด ์ข‹๋‹ค. font๊ฐ€ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ๋†’์ด๋ณด๋‹ค 2~4px๊ฐ’ ๋”ํ•ด์„œ ์ž…๋ ฅํ•ด์ฃผ๋Š”๊ฒƒ์ด ์ข‹์Œ*/
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.main_list .title {
    margin-top: 3px; /*๊ฐ„๊ฒฉ*/
    font-size: 18px;
    line-height: 22px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

์„œ๋ธŒ ๋ฆฌ์ŠคํŠธ ์ œ์ž‘

<!DOCTYPE html>
<html lang="ko">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <!-- http://meyerweb.com/eric/tools/css/reset/ -->
    <link rel="stylesheet" href="reset.css">
    <link rel="stylesheet" href="style_1.css">
    <title>๋„ค์ด๋ฒ„TV: ๊ฐ„๋‹จํ•œ ์ด๋ฏธ์ง€ ๋ฆฌ์ŠคํŠธ</title>
</head>
<body>
    <div class="wrap">
        <h1>TOP100</h1>
        <div class="main_wrap">
            <div class="content">
                <p class="noti_txt">8.21 ์˜ค์ „ 9์‹œ ~ ์˜ค์ „ 10์‹œ ๊ธฐ์ค€ (์žฌ์ƒ์ˆ˜, ์žฌ์ƒ์‹œ๊ฐ„, ์ข‹์•„์š”)</p>
                <ol class="main_list">
                    <li>
                        <a href="#" class="item_link">
                            <div class="img_box">
                                <img src="./img/thumb_image_large.jpg" alt="">
                            </div>
                            <div class="info">
                                <span class="category">์‚ฐ์•…์Šคํ‚ค</span>
                                <p class="title">์˜ค์ŠคํŠธ๋ฆฌ์•„ ์ตœ๋Œ€์˜ ์‚ฐ์•…์Šคํ‚ค ์—ฐ๋งน, ์‚ฐ์•…์Šคํ‚ค ์•„๋งˆ๋ฐ! 5๊ฐœ ์ง€์—ญ์— ๊ฑธ์ณ์žˆ๊ณ , ์ด 25์—ฌ๊ฐœ์˜ ์Šฌ๋กœํ”„ ๊ธธ์ด</p>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="#" class="item_link">
                            <div class="img_box">
                                <img src="./img/thumb_image_large.jpg" alt="">
                            </div>
                            <div class="info">
                                <span class="category">์‚ฐ์•…์Šคํ‚ค</span>
                                <p class="title">์˜ค์ŠคํŠธ๋ฆฌ์•„ ์ตœ๋Œ€์˜ ์‚ฐ์•…์Šคํ‚ค ์—ฐ๋งน, ์‚ฐ์•…์Šคํ‚ค ์•„๋งˆ๋ฐ! 5๊ฐœ ์ง€์—ญ์— ๊ฑธ์ณ์žˆ๊ณ , ์ด 25์—ฌ๊ฐœ์˜ ์Šฌ๋กœํ”„ ๊ธธ์ด</p>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="#" class="item_link">
                            <div class="img_box">
                                <img src="./img/thumb_image_large.jpg" alt="">
                            </div>
                            <div class="info">
                                <span class="category">์‚ฐ์•…์Šคํ‚ค</span>
                                <p class="title">์˜ค์ŠคํŠธ๋ฆฌ์•„ ์ตœ๋Œ€์˜ ์‚ฐ์•…์Šคํ‚ค ์—ฐ๋งน, ์‚ฐ์•…์Šคํ‚ค ์•„๋งˆ๋ฐ! 5๊ฐœ ์ง€์—ญ์— ๊ฑธ์ณ์žˆ๊ณ , ์ด 25์—ฌ๊ฐœ์˜ ์Šฌ๋กœํ”„ ๊ธธ์ด</p>
                            </div>
                        </a>
                    </li>
                </ol>
            </div>
        </div>
      <!--์„œ๋ธŒ ๋ฆฌ์ŠคํŠธ-->
        <div class="sub_wrap">
            <ol class="sub_list" start="4">
                    <li>
                        <a href="#" class="item_link">
                            <img src="./img/thumb_image.jpg" alt="">
                        </a>
                        <div class="info">
                            <a href="#" class="title">๊ตญ์ œ์œก์ƒ๊ฒฝ๊ธฐ์—ฐ๋งน์œผ๋กœ๋ถ€ํ„ฐ ๋ผ๋ฒจ์„ ๋ถ€์—ฌ๋ฐ›์€ ๊ตญ๋‚ด์˜ ๋‹จ ๋‘ ๊ฐœ์˜ ๋งˆ๋ผํ†ค ๋Œ€ํšŒ ์ค‘ ์‹ค๋ฒ„๋ผ๋ฒจ์„ 5๋…„ ์—ฐ์† ์œ ์ง€ํ•˜๊ณ  ์žˆ๋Š” ๋Œ€๊ตฌ๊ตญ์ œ๋งˆ๋ผํ†ค๋Œ€ํšŒ!</a>
                            <a href="#" class="category_link">๋งˆ๋ผํ†ค</a>
                        </div>
                    </li>
                    <li>
                        <a href="#" class="item_link">
                            <img src="./img/thumb_image.jpg" alt="">
                        </a>
                        <div class="info">
                            <a href="#" class="title">๊ตญ์ œ์œก์ƒ๊ฒฝ๊ธฐ์—ฐ๋งน์œผ๋กœ๋ถ€ํ„ฐ ๋ผ๋ฒจ์„ ๋ถ€์—ฌ๋ฐ›์€ ๊ตญ๋‚ด์˜ ๋‹จ ๋‘ ๊ฐœ์˜ ๋งˆ๋ผํ†ค ๋Œ€ํšŒ ์ค‘ ์‹ค๋ฒ„๋ผ๋ฒจ์„ 5๋…„ ์—ฐ์† ์œ ์ง€ํ•˜๊ณ  ์žˆ๋Š” ๋Œ€๊ตฌ๊ตญ์ œ๋งˆ๋ผํ†ค๋Œ€ํšŒ!</a>
                            <a href="#" class="category_link">๋งˆ๋ผํ†ค</a>
                        </div>
                    </li>
                    <li>
                        <a href="#" class="item_link">
                            <img src="./img/thumb_image.jpg" alt="">
                        </a>
                        <div class="info">
                            <a href="#" class="title">๊ตญ์ œ์œก์ƒ๊ฒฝ๊ธฐ์—ฐ๋งน์œผ๋กœ๋ถ€ํ„ฐ ๋ผ๋ฒจ์„ ๋ถ€์—ฌ๋ฐ›์€ ๊ตญ๋‚ด์˜ ๋‹จ ๋‘ ๊ฐœ์˜ ๋งˆ๋ผํ†ค ๋Œ€ํšŒ ์ค‘ ์‹ค๋ฒ„๋ผ๋ฒจ์„ 5๋…„ ์—ฐ์† ์œ ์ง€ํ•˜๊ณ  ์žˆ๋Š” ๋Œ€๊ตฌ๊ตญ์ œ๋งˆ๋ผํ†ค๋Œ€ํšŒ!</a>
                            <a href="#" class="category_link">๋งˆ๋ผํ†ค</a>
                        </div>
                    </li>
                    <li>
                        <a href="#" class="item_link">
                            <img src="./img/thumb_image.jpg" alt="">
                        </a>
                        <div class="info">
                            <a href="#" class="title">๊ตญ์ œ์œก์ƒ๊ฒฝ๊ธฐ์—ฐ๋งน์œผ๋กœ๋ถ€ํ„ฐ ๋ผ๋ฒจ์„ ๋ถ€์—ฌ๋ฐ›์€ ๊ตญ๋‚ด์˜ ๋‹จ ๋‘ ๊ฐœ์˜ ๋งˆ๋ผํ†ค ๋Œ€ํšŒ ์ค‘ ์‹ค๋ฒ„๋ผ๋ฒจ์„ 5๋…„ ์—ฐ์† ์œ ์ง€ํ•˜๊ณ  ์žˆ๋Š” ๋Œ€๊ตฌ๊ตญ์ œ๋งˆ๋ผํ†ค๋Œ€ํšŒ!</a>
                            <a href="#" class="category_link">๋งˆ๋ผํ†ค</a>
                        </div>
                    </li>
                    <li>
                        <a href="#" class="item_link">
                            <img src="./img/thumb_image.jpg" alt="">
                        </a>
                        <div class="info">
                            <a href="#" class="title">๊ตญ์ œ์œก์ƒ๊ฒฝ๊ธฐ์—ฐ๋งน์œผ๋กœ๋ถ€ํ„ฐ ๋ผ๋ฒจ์„ ๋ถ€์—ฌ๋ฐ›์€ ๊ตญ๋‚ด์˜ ๋‹จ ๋‘ ๊ฐœ์˜ ๋งˆ๋ผํ†ค ๋Œ€ํšŒ ์ค‘ ์‹ค๋ฒ„๋ผ๋ฒจ์„ 5๋…„ ์—ฐ์† ์œ ์ง€ํ•˜๊ณ  ์žˆ๋Š” ๋Œ€๊ตฌ๊ตญ์ œ๋งˆ๋ผํ†ค๋Œ€ํšŒ!</a>
                            <a href="#" class="category_link">๋งˆ๋ผํ†ค</a>
                        </div>
                    </li>
                    <li>
                        <a href="#" class="item_link">
                            <img src="./img/thumb_image.jpg" alt="">
                        </a>
                        <div class="info">
                            <a href="#" class="title">๊ตญ์ œ์œก์ƒ๊ฒฝ๊ธฐ์—ฐ๋งน์œผ๋กœ๋ถ€ํ„ฐ ๋ผ๋ฒจ์„ ๋ถ€์—ฌ๋ฐ›์€ ๊ตญ๋‚ด์˜ ๋‹จ ๋‘ ๊ฐœ์˜ ๋งˆ๋ผํ†ค ๋Œ€ํšŒ ์ค‘ ์‹ค๋ฒ„๋ผ๋ฒจ์„ 5๋…„ ์—ฐ์† ์œ ์ง€ํ•˜๊ณ  ์žˆ๋Š” ๋Œ€๊ตฌ๊ตญ์ œ๋งˆ๋ผํ†ค๋Œ€ํšŒ!</a>
                            <a href="#" class="category_link">๋งˆ๋ผํ†ค</a>
                        </div>
                    </li>
                    <li>
                        <a href="#" class="item_link">
                            <img src="./img/thumb_image.jpg" alt="">
                        </a>
                        <div class="info">
                            <a href="#" class="title">๊ตญ์ œ์œก์ƒ๊ฒฝ๊ธฐ์—ฐ๋งน์œผ๋กœ๋ถ€ํ„ฐ ๋ผ๋ฒจ์„ ๋ถ€์—ฌ๋ฐ›์€ ๊ตญ๋‚ด์˜ ๋‹จ ๋‘ ๊ฐœ์˜ ๋งˆ๋ผํ†ค ๋Œ€ํšŒ ์ค‘ ์‹ค๋ฒ„๋ผ๋ฒจ์„ 5๋…„ ์—ฐ์† ์œ ์ง€ํ•˜๊ณ  ์žˆ๋Š” ๋Œ€๊ตฌ๊ตญ์ œ๋งˆ๋ผํ†ค๋Œ€ํšŒ!</a>
                            <a href="#" class="category_link">๋งˆ๋ผํ†ค</a>
                        </div>
                    </li>
                    <li>
                        <a href="#" class="item_link">
                            <img src="./img/thumb_image.jpg" alt="">
                        </a>
                        <div class="info">
                            <a href="#" class="title">๊ตญ์ œ์œก์ƒ๊ฒฝ๊ธฐ์—ฐ๋งน์œผ๋กœ๋ถ€ํ„ฐ ๋ผ๋ฒจ์„ ๋ถ€์—ฌ๋ฐ›์€ ๊ตญ๋‚ด์˜ ๋‹จ ๋‘ ๊ฐœ์˜ ๋งˆ๋ผํ†ค ๋Œ€ํšŒ ์ค‘ ์‹ค๋ฒ„๋ผ๋ฒจ์„ 5๋…„ ์—ฐ์† ์œ ์ง€ํ•˜๊ณ  ์žˆ๋Š” ๋Œ€๊ตฌ๊ตญ์ œ๋งˆ๋ผํ†ค๋Œ€ํšŒ!</a>
                            <a href="#" class="category_link">๋งˆ๋ผํ†ค</a>
                        </div>
                    </li>
                    <li>
                        <a href="#" class="item_link">
                            <img src="./img/thumb_image.jpg" alt="">
                        </a>
                        <div class="info">
                            <a href="#" class="title">๊ตญ์ œ์œก์ƒ๊ฒฝ๊ธฐ์—ฐ๋งน์œผ๋กœ๋ถ€ํ„ฐ ๋ผ๋ฒจ์„ ๋ถ€์—ฌ๋ฐ›์€ ๊ตญ๋‚ด์˜ ๋‹จ ๋‘ ๊ฐœ์˜ ๋งˆ๋ผํ†ค ๋Œ€ํšŒ ์ค‘ ์‹ค๋ฒ„๋ผ๋ฒจ์„ 5๋…„ ์—ฐ์† ์œ ์ง€ํ•˜๊ณ  ์žˆ๋Š” ๋Œ€๊ตฌ๊ตญ์ œ๋งˆ๋ผํ†ค๋Œ€ํšŒ!</a>
                            <a href="#" class="category_link">๋งˆ๋ผํ†ค</a>
                        </div>
                    </li>
                    <li>
                        <a href="#" class="item_link">
                            <img src="./img/thumb_image.jpg" alt="">
                        </a>
                        <div class="info">
                            <a href="#" class="title">๊ตญ์ œ์œก์ƒ๊ฒฝ๊ธฐ์—ฐ๋งน์œผ๋กœ๋ถ€ํ„ฐ ๋ผ๋ฒจ์„ ๋ถ€์—ฌ๋ฐ›์€ ๊ตญ๋‚ด์˜ ๋‹จ ๋‘ ๊ฐœ์˜ ๋งˆ๋ผํ†ค ๋Œ€ํšŒ ์ค‘ ์‹ค๋ฒ„๋ผ๋ฒจ์„ 5๋…„ ์—ฐ์† ์œ ์ง€ํ•˜๊ณ  ์žˆ๋Š” ๋Œ€๊ตฌ๊ตญ์ œ๋งˆ๋ผํ†ค๋Œ€ํšŒ!</a>
                            <a href="#" class="category_link">๋งˆ๋ผํ†ค</a>
                        </div>
                    </li>
                </ol>
        </div>
    </div>
</body>
</html>
@charset "UTF-8";

/* ๊ธฐ๋ณธ ์Šคํƒ€์ผ */
body {
    font-family: Dotum,'๋‹์›€', Helvetica, sans-serif;
    font-size: 15px;
    line-height: 18px;
    color: #3c3c3c;
}
a {
    color: inherit;
    text-decoration: none;
    vertical-align: top;
}
img {
    vertical-align: top;
}
h1 {
    overflow: hidden;
    width: 1000px;
    margin: 0 auto;
    padding: 20px 0;
    line-height: 38px;
    font-size: 26px;
    color: #000;
}
.main_wrap {
    background-color: #ececec;
}
.main_wrap .content {
    position: relative;
    width: 1000px;
    margin: 0 auto;
    padding: 50px 0 20px;
}
.main_wrap .noti_txt {
    position: absolute;
    top: 20px;
    right: 0;
    font-size: 12px;
    color: #7c7c7c;
}
.main_list:after {
    display: block;
    content: '';
    clear: both;
}
.main_list li {
    float: left;
}
.main_list li + li {
    margin-left: 17px;
}
.main_list li .item_link {
    position: relative;
    display: block;
}
.main_list .img_box {
    position: relative;
}
.main_list .img_box:after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    content: '';
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.05);
}
.main_list .img_box img {
    width: 322px;
    height: 215px;
}
.main_list .info {
    position: absolute;
    right: 15px;
    bottom: 15px;
    left: 15px;
    color: #fff;
    overflow: hidden;
}
.main_list .category {
    font-size: 14px;
}
.main_list .title {
    margin-top: 3px;
    font-size: 18px;
    line-height: 22px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/*์„œ๋ธŒ ๋ฆฌ์ŠคํŠธ*/
.sub_wrap {
    margin-top: 30px; /*๋ฉ”์ธ ๋ฆฌ์ŠคํŠธ์™€์˜ ๊ฐ„๊ฒฉ*/
}
.sub_list {
    width: 1000px;
    margin: 0 auto;
}
.sub_list:after { /*float ํ•ด์ œ*/
    display: block;
    content: '';
    clear: both;
}
.sub_list li {
    float: left;
    width: 188px; /*์„ฌ๋„ค์ผ ๋ฐ‘ ํ…์ŠคํŠธ๊ฐ€ ๋ถ€๋ชจ ๊ตฌ์กฐ์˜ ๋„ˆ๋น„๋ฅผ ์•Œ๊ณ  ์žˆ์–ด์•ผ์ง€ ๋ง์ค„์ž„์„ ์‹œํ‚ฌ ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ width ์„ ์–ธ*/
    margin-bottom: 40px; /*์•„์ดํ…œ ์‚ฌ์ด ๊ฐ„๊ฒฉ*/
}
.sub_list li + li { /*์„ฌ๋„ค์ผ ์‚ฌ์ด ๊ฐ„๊ฒฉ*/
    margin-left: 15px;
}
.sub_list li:nth-child(5n+1) { /*2๋ฒˆ์ค„ ์ด์ƒ๋ถ€ํ„ฐ ์ฒซ๋ฒˆ์งธ ์š”์†Œ๋„ ์™ผ์ชฝ ์—ฌ๋ฐฑ ๊ฐ€์ง€๋ฉด ์•ˆ๋จ*/
    margin-left: 0;
}

/*์™ธ๊ณฝ์„  */
.sub_list .item_link {
    display: block; /*a๋ฅผ ๋ธ”๋ก ์š”์†Œ๋กœ ์ง€์ •*/
    position: relative;
}
.sub_list .item_link:after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    content: '';
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.sub_list .item_link img { /*์ด๋ฏธ์ง€ ์‚ฌ์ด์ฆˆ*/
    width: 188px;
    height: 141px;
}
.sub_list .info {
    height: 79px; /*๊ณ ์ • ๋†’์ด๊ฐ’*/
    margin-top: 10px;
    padding: 5px;
}
.sub_list .title { /*๋‘ ์ค„ ๋ง์ค„์ž„*/
    display: -webkit-box;
    overflow: hidden;
    max-height: 36px; /*webkit ์ด์™ธ ๋ธŒ๋ผ์šฐ์ € ๋Œ€์‘*/
    font-size: 15px;
    line-height: 18px;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    word-break: break-all;
    color: #090909;
}
.sub_list .category_link {
    display: block;
    padding-top: 3px;
    font-size: 12px;
    color: #7ba7df;
    line-height:15px;
    /*ํ•œ ์ค„ ๋ง์ค„์ž„*/
    text-overflow:ellipsis;
    overflow:hidden;
    white-space:nowrap
    
}

์ •๋ฆฌ

  • ์ด๋ฏธ์ง€ ์ •๋ ฌ float, clear, :nth-child
    ์„ฌ๋„ค์ผ๋“ค์„ ์ขŒ์ธก์œผ๋กœ ์ด์–ด ๋ถ™์ด๊ฒŒ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด float ์‚ฌ์šฉ
    float์„ ์‚ฌ์šฉํ•œ ํ›„์—๋Š” ํ•ญ์ƒ float ํ•ด์ œํ•˜๋Š” clear ์†์„ฑ ์‚ฌ์šฉํ•˜์—ฌ ๋ถ€๋ชจ๊ฐ€ ์ž์‹์š”์†Œ์˜ ๋†’์ด๊ฐ’์„ ์ธ์‹ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ด์•ผ ํ•œ๋‹ค.
    nth-child : ํŠน์ • ์š”์†Œ์˜ ๋ช‡๋ฒˆ์งธ ์š”์†Œ์ธ์ง€ ์„ ํƒํ•˜๋Š” ์„ ํƒ์ž. ํŠน์ • ์ด๋ฏธ์ง€๋ฅผ ์„ ํƒํ•˜์—ฌ ์—ฌ๋ฐฑ ์ œ๊ฑฐ์— ์œ ์šฉ

  • ์ด๋ฏธ์ง€ ์•ก์ž : after, position, border, rgba

  • ํ…์ŠคํŠธ ๋ง์ค„์ž„

    • text-overflow, overflow, white-space ํ•œ์ค„๋ง์ค„์ž„
    • -webkit-box, -webkit-box-orient, -webkit-line-clamp ๋‘ ์ค„ ๋ง์ค„์ž„

height IE, ํŒŒ์ด์–ดํญ์Šค์—์„œ webkit ๊ด€๋ จ ์†์„ฑ์ด ์ ์šฉ๋˜์ง€ ์•Š์œผ๋ฏ€๋กœ ๋ฐ˜๋“œ์‹œ height์ด๋‚˜ max-height ๋„ฃ์–ด์„œ ๋Œ€์‘ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ด์•ผํ•œ๋‹ค.


์ด๋ฏธ์ง€ ๋ชฉ๋ก ์ถ”๊ฐ€ ์ œ์ž‘


์ด๋ฏธ์ง€ ๋ฆฌ์ŠคํŠธ์— ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ํ•˜์—ฌ ์ปจํ…์ธ ๋ฅผ ๊พธ๋ฏธ๊ธฐ
์„ฌ๋„ค์ผ ์œ„๋กœ ๋ฐฉ์†ก์‹œ๊ฐ„, ์ˆœ์œ„์ƒ์Šน ์œ ์ง€๋“ฑ ์•„์ด์ฝ˜ ํ‘œ์‹œ


UI ๊ฐ€์ด๋“œ ์ดํ•ดํ•˜๊ธฐ

๋ฉ”์ธ ๋ฆฌ์ŠคํŠธ ๊ธฐ๋Šฅ ์ถ”๊ฐ€

  • ๋ฐฉ์†ก ์ˆœ์œ„ ํ…์ŠคํŠธ์˜ ์‚ฌ์ด์ฆˆ, ์ปฌ๋Ÿฌ
  • ์ˆœ์œ„ ๋ณ€ํ™” ๋ถ€๋ถ„
  • ํ…์ŠคํŠธ, ํ•˜ํŠธ ์•„์ด์ฝ˜

์„œ๋ธŒ ๋ฆฌ์ŠคํŠธ ๊ธฐ๋Šฅ ์ถ”๊ฐ€

  • ๋ฐฉ์†ก ์ˆœ์œ„, ์ˆœ์œ„ ๋ณ€ํ™” ํ‘œ์‹œ
  • ์„ฌ๋„ค์ผ ์œ„๋กœ ์žฌ์ƒ์‹œ๊ฐ„ ํ‘œ์‹œ. ๋ฐ˜ํˆฌ๋ช… ๋ฐฑ๊ทธ๋ผ์šด๋“œ ๋ฐ•์Šค, ์ˆซ์ž๋Š” ์ตœ๋Œ€ 4์ž๋ฆฌ๊นŒ์ง€ ์ž…๋ ฅ๊ฐ€๋Šฅ
  • ๋งˆ์šฐ์Šค ์˜ค๋ฒ„ ์‹œ ์žฌ์ƒ์‹œ๊ฐ„์ด ์‚ฌ๋ผ์ง€๊ณ  ๋‚˜์ค‘์— ๋ณด๊ธฐ ๋ฒ„ํŠผ ๋…ธ์ถœ

์•„์ด์ฝ˜๋“ค์€ ํˆฌ๋ช… ๋ฐฐ๊ฒฝ ๊ฐ–๊ณ  ์žˆ์œผ๋ฏ€๋กœ png ํŒŒ์ผ ์‚ฌ์šฉ

์ฃผ์š” ํƒœ๊ทธ ๋ฐ ์Šคํƒ€์ผ

  • HTML
    div, span, a
  • CSS
    position, margin, background, :before, :after, :hover

1. ์•„์ด์ฝ˜ ์ƒํƒœ ๋ณ€๊ฒฝ

<div class="change"><span class="blind">์ฒซ์งธ</span></div>
<div class="change up"><span class="blind">๋‘˜์งธ</span></div>
<div class="change down"><span class="blind">์…‹์งธ</span></div>

div ํ•˜๋‚˜๋‹น ํ•˜๋‚˜์˜ ๋ฐ•์Šค
span์œผ๋กœ ๊ฐ์‹ผ ํ…์ŠคํŠธ๋Š” ํ™”๋ฉด์— ๋…ธ์ถœ์•ˆ๋จ

.change {
  float: left; /*์ขŒ์ธก์œผ๋กœ ์ด์–ด๋ถ™๊ฒŒ*/
  padding: 10px;
  text-align: center;
}
.change:after {
  display: block;
  width: 100px;
  height: 100px;
  content: '';
  border: 1px solid gray;
  background-color: pink;
}
.up:after {
  background: url(https://image.flaticon.com/icons/png/512/187/187142.png) no-repeat; /*๋ฐฑ๊ทธ๋ผ์šด๋“œ ์ด๋ฏธ์ง€. ๋ฐ˜๋ณตx*/
  background-size: cover;
}
.down:after {
  background: url(https://image.flaticon.com/icons/png/512/187/187154.png) no-repeat;
  background-size: cover;
}
/* IR(*Image Replacement) ์ฒ˜๋ฆฌ */
.blind {
  overflow: hidden;
  position: absolute;
  clip: rect(0 0 0 0);
  width: 1px;
  height: 1px;
  margin: -1px;
}

2. ๋งˆ์šฐ์Šค ์˜ค๋ฒ„ ์‹œ ๋ฒ„ํŠผ ๋…ธ์ถœ

<div class="box test1">
  <a href="#" class="img_link">
    <img src="https://image.flaticon.com/icons/png/512/124/124027.png" width="100" height="100" alt="">
    <span class="alert">99</span>
  </a>
  <a href="#" class="del_link">x</a> <!--๋งˆ์šฐ์Šค ์˜ค๋ฒ„์‹œ ๋‹ซ๊ธฐ๋ฒ„ํŠผ-->
</div>

<div class="box test2">
  <a href="#" class="img_link">
    <img src="https://image.flaticon.com/icons/png/512/124/124027.png" width="100" height="100" alt="">
    <span class="alert">99</span>
  </a>
  <a href="#" class="del_link">x</a>
</div>
.box {
  position: relative; /*del_link์˜ position์œ„ํ•ด. ๋ถ€๋ชจ์š”์†Œ*/
  width: 100px;
  height: 100px;
}
.box + .box {
  margin-top: 30px;
}
.img_link {
  position: relative; /*alert์˜ ๋ถ€๋ชจ*/
  display: inline-block; /*๋ฐ•์Šค ์ „์ฒด์— ๋งํฌ ์˜์—ญ์„ ์ธ์‹์‹œํ‚ค๊ธฐ ์œ„ํ•ด*/
  width: 100px;
  height: 100px;
}
.alert {
/*์šฐ์ธก ํ•˜๋‹จ์— ๋ฐฐ์น˜*/
  position: absolute;
  right: 4px;
  bottom: 4px;
  
  padding: 0 10px;
  font-size: 12px;
  line-height: 18px;  
  color: #fff;
  background-color: rgba(0, 0, 0, 0.5);
}
.del_link {
  display: none; /*default๋กœ ๋…ธ์ถœ๋˜์ง€ ์•Š์Œ*/
  /*์šฐ์ธก ์ƒ๋‹จ ๋ฐฐ์น˜*/
  position: absolute;
  top:0;
  right: 0;
  
  padding: 5px 10px;
  font-size: 14px;
  color: #fff;
  text-decoration: none;/*a์˜ ๊ธฐ๋ณธ ์Šคํƒ€์ผ ์ดˆ๊ธฐํ™”*/
  background-color: rgba(0, 0, 0, 0.5);
}

/*1. img_link ๋ฐ•์Šค ์˜์—ญ์„ ์˜ค๋ฒ„ํ–ˆ์„๋•Œ */
.test1 .img_link:hover + .del_link {
	display: block;
}
/*2. ์ตœ์ƒ์œ„ ๊ตฌ์กฐ๋ฅผ ์˜ค๋ฒ„ํ–ˆ์„๋•Œ*/
.test2:hover > .del_link {
	display: block;
}
/*๋‘˜์˜ ์ฐจ์ด์ ์€ ๊ฒ‰์œผ๋กœ๋Š” ํฐ ์ฐจ์ด๊ฐ€ ์—†์ง€๋งŒ ์ฒซ๋ฒˆ์งธ ๋ฐฉ๋ฒ•์€ ์ด๋ฏธ์ง€๋ฅผ ์˜ค๋ฒ„ํ–ˆ์„๋•Œ๋Š” ์ •์ƒ์ ์œผ๋กœ ๋ฒ„ํŠผ์ด ๋…ธ์ถœ๋˜์ง€๋งŒ ๋ฒ„ํŠผ์— ์˜ค๋ฒ„ํ–ˆ์„๋•Œ๋Š” ๋ฒ„ํŠผ์ด ๊นœ๋นก๊นœ๋นก ๊ฑฐ๋ฆฌ๊ฒŒ๋จ. ์™œ๋ƒ๋ฉด img_link์— ์˜ค๋ฒ„ํ–ˆ์„๋•Œ๋Š” x๋ฒ„ํŠผ์ด ๋…ธ์ถœ๋˜๋Š”๋ฐ ๋ฒ„ํŠผ์— ์˜ค๋ฒ„ํ–ˆ์„๋•Œ๋Š” img_link:hover์˜ display:block์ด ํ’€๋ ค๋ฒ„๋ฆฌ๊ฒŒ๋จ. ์ฆ‰ ๋ฒ„ํŠผ์— ์˜ค๋ฒ„์‹œ ์ด๋ฏธ์ง€๋งํฌ๊ฐ€ ๊ฐ–๋Š” ์˜ค๋ฒ„๊ฐ€ ํ’€๋ ค์„œ ๋ฒ„ํŠผ์ด ์‚ฌ๋ผ์กŒ๋‹ค๊ฐ€ ๋ฒ„ํŠผ์ด ์‚ฌ๋ผ์ง€๋ฉด ๋‹ค์‹œ ์ด๋ฏธ์ง€๋งํฌ์— ์˜ค๋ฒ„๊ฐ€ ๋˜๋ฉด์„œ ๋ฒ„ํŠผ์ด ๋…ธ์ถœ๋˜๋Š” ์ฆ์ƒ์ด ๋ฐ˜๋ณต๋˜๋Š”๊ฒƒ.
2๋ฒˆ์€ ์ •์ƒ์ ์œผ๋กœ ์ž‘๋™ํ•จ. ์•ต์ปค์š”์†Œ์—๋งŒ hover๋ฅผ ์„ ์–ธํ•  ์ˆ˜ ์žˆ๋Š”๊ฒƒ์ด ์•„๋‹ˆ๋‹ค.

์ถ”๊ฐ€ ๊ธฐ๋Šฅ ์ œ์ž‘ํ•˜๊ธฐ

<!DOCTYPE html>
<html lang="ko">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <!-- http://meyerweb.com/eric/tools/css/reset/ -->
    <link rel="stylesheet" href="reset.css">
    <link rel="stylesheet" href="style_2.css">
    <title>๋„ค์ด๋ฒ„TV: ๊ฐ„๋‹จํ•œ ์ด๋ฏธ์ง€ ๋ฆฌ์ŠคํŠธ</title>
</head>
<body>
    <div class="wrap">
        <h1>TOP100</h1>
        <div class="main_wrap">
            <div class="content">
                <p class="noti_txt">8.21 ์˜ค์ „ 9์‹œ ~ ์˜ค์ „ 10์‹œ ๊ธฐ์ค€ (์žฌ์ƒ์ˆ˜, ์žฌ์ƒ์‹œ๊ฐ„, ์ข‹์•„์š”)</p>
                <ol class="main_list">
                    <li>
                        <a href="#" class="item_link">
                            <div class="img_box">
                                <img src="./img/thumb_main.jpg" alt="">
                            </div>
                            <div class="info_wrap">
                                <div class="rank">
                                    <span class="num"><span class="blind">๋žญํ‚น</span>1</span>
                                    <span class="change up">3<span class="blind">์ƒ์Šน</span></span>
                                </div>
                                <div class="info">
                                    <span class="category">์‚ฐ์•…์Šคํ‚ค</span>
                                    <p class="title">์˜ค์ŠคํŠธ๋ฆฌ์•„ ์ตœ๋Œ€์˜ ์‚ฐ์•…์Šคํ‚ค ์—ฐ๋งน, ์‚ฐ์•…์Šคํ‚ค ์•„๋งˆ๋ฐ! 5๊ฐœ ์ง€์—ญ์— ๊ฑธ์ณ์žˆ๊ณ , ์ด 25์—ฌ๊ฐœ์˜ ์Šฌ๋กœํ”„ ๊ธธ์ด</p>
                                    <span class="like"><span class="blind">์ข‹์•„์š”</span>99,999</span>
                                </div>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="#" class="item_link">
                            <div class="img_box">
                                <img src="./img/thumb_main.jpg" alt="">
                            </div>
                            <div class="info_wrap">
                                <div class="rank">
                                    <span class="num"><span class="blind">๋žญํ‚น</span>2</span>
                                    <span class="change down">3<span class="blind">ํ•˜๋ฝ</span></span>
                                </div>
                                <div class="info">
                                    <span class="category">์‚ฐ์•…์Šคํ‚ค</span>
                                    <p class="title">์˜ค์ŠคํŠธ๋ฆฌ์•„ ์ตœ๋Œ€์˜ ์‚ฐ์•…์Šคํ‚ค ์—ฐ๋งน, ์‚ฐ์•…์Šคํ‚ค ์•„๋งˆ๋ฐ! 5๊ฐœ ์ง€์—ญ์— ๊ฑธ์ณ์žˆ๊ณ , ์ด 25์—ฌ๊ฐœ์˜ ์Šฌ๋กœํ”„ ๊ธธ์ด</p>
                                    <span class="like"><span class="blind">์ข‹์•„์š”</span>99,999</span>
                                </div>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="#" class="item_link">
                            <div class="img_box">
                                <img src="./img/thumb_main.jpg" alt="">
                            </div>
                            <div class="info_wrap">
                                <div class="rank">
                                    <span class="num"><span class="blind">๋žญํ‚น</span>3</span>
                                    <span class="change keep"><span class="blind">์œ ์ง€</span></span>
                                </div>
                                <div class="info">
                                    <span class="category">์‚ฐ์•…์Šคํ‚ค</span>
                                    <p class="title">์˜ค์ŠคํŠธ๋ฆฌ์•„ ์ตœ๋Œ€์˜ ์‚ฐ์•…์Šคํ‚ค ์—ฐ๋งน, ์‚ฐ์•…์Šคํ‚ค ์•„๋งˆ๋ฐ! 5๊ฐœ ์ง€์—ญ์— ๊ฑธ์ณ์žˆ๊ณ , ์ด 25์—ฌ๊ฐœ์˜ ์Šฌ๋กœํ”„ ๊ธธ์ด</p>
                                    <span class="like"><span class="blind">์ข‹์•„์š”</span>99,999</span>
                                </div>
                            </div>
                        </a>
                    </li>
                </ol>
            </div>
        </div>
        <div class="sub_wrap">
            <ol class="sub_list">
                    <li>
                        <div class="img_wrap">
                            <a href="#" class="item_link">
                                <img src="./img/thumb_sub.jpg" alt="">
                                <span class="time"><span class="blind">์žฌ์ƒ์‹œ๊ฐ„</span>99:99</span>
                            </a>
                            <a href="#" class="watch_later_link"><span class="blind">๋‚˜์ค‘์— ๋ณด๊ธฐ</span></a>
                        </div>
                         <div class="info_wrap">
                            <div class="rank">
                                <span class="num"><span class="blind">๋žญํ‚น</span>4</span>
                                <span class="change up">3<span class="blind">์ƒ์Šน</span></span>
                            </div>
                            <div class="info">
                                <a href="#" class="title">๊ตญ์ œ์œก์ƒ๊ฒฝ๊ธฐ์—ฐ๋งน์œผ๋กœ๋ถ€ํ„ฐ ๋ผ๋ฒจ์„ ๋ถ€์—ฌ๋ฐ›์€ ๊ตญ๋‚ด์˜ ๋‹จ ๋‘ ๊ฐœ์˜ ๋งˆ๋ผํ†ค ๋Œ€ํšŒ ์ค‘ ์‹ค๋ฒ„๋ผ๋ฒจ์„ 5๋…„ ์—ฐ์† ์œ ์ง€ํ•˜๊ณ  ์žˆ๋Š” ๋Œ€๊ตฌ๊ตญ์ œ๋งˆ๋ผํ†ค๋Œ€ํšŒ!</a>
                                <a href="#" class="category_link">๋งˆ๋ผํ†ค</a>
                                <span class="like"><span class="blind">์ข‹์•„์š”</span>99,999</span>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="img_wrap">
                            <a href="#" class="item_link">
                                <img src="./img/thumb_sub.jpg" alt="">
                                <span class="time"><span class="blind">์žฌ์ƒ์‹œ๊ฐ„</span>99:99</span>
                            </a>
                            <a href="#" class="watch_later_link"><span class="blind">๋‚˜์ค‘์— ๋ณด๊ธฐ</span></a>
                        </div>
                        <div class="info_wrap">
                            <div class="rank">
                                <span class="num"><span class="blind">๋žญํ‚น</span>5</span>
                                <span class="change down">2<span class="blind">ํ•˜๋ฝ</span></span>
                            </div>
                            <div class="info">
                                <a href="#" class="title">๊ตญ์ œ์œก์ƒ๊ฒฝ๊ธฐ์—ฐ๋งน์œผ๋กœ๋ถ€ํ„ฐ ๋ผ๋ฒจ์„ ๋ถ€์—ฌ๋ฐ›์€ ๊ตญ๋‚ด์˜ ๋‹จ ๋‘ ๊ฐœ์˜ ๋งˆ๋ผํ†ค ๋Œ€ํšŒ ์ค‘ ์‹ค๋ฒ„๋ผ๋ฒจ์„ 5๋…„ ์—ฐ์† ์œ ์ง€ํ•˜๊ณ  ์žˆ๋Š” ๋Œ€๊ตฌ๊ตญ์ œ๋งˆ๋ผํ†ค๋Œ€ํšŒ!</a>
                                <a href="#" class="category_link">๋งˆ๋ผํ†ค</a>
                                <span class="like"><span class="blind">์ข‹์•„์š”</span>99,999</span>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="img_wrap">
                            <a href="#" class="item_link">
                                <img src="./img/thumb_sub.jpg" alt="">
                                <span class="time"><span class="blind">์žฌ์ƒ์‹œ๊ฐ„</span>99:99</span>
                            </a>
                            <a href="#" class="watch_later_link"><span class="blind">๋‚˜์ค‘์— ๋ณด๊ธฐ</span></a>
                        </div>
                        <div class="info_wrap">
                            <div class="rank">
                                <span class="num"><span class="blind">๋žญํ‚น</span>6</span>
                                <span class="change keep"><span class="blind">์œ ์ง€</span></span>
                            </div>
                            <div class="info">
                                <a href="#" class="title">๊ตญ์ œ์œก์ƒ๊ฒฝ๊ธฐ์—ฐ๋งน์œผ๋กœ๋ถ€ํ„ฐ ๋ผ๋ฒจ์„ ๋ถ€์—ฌ๋ฐ›์€ ๊ตญ๋‚ด์˜ ๋‹จ ๋‘ ๊ฐœ์˜ ๋งˆ๋ผํ†ค ๋Œ€ํšŒ ์ค‘ ์‹ค๋ฒ„๋ผ๋ฒจ์„ 5๋…„ ์—ฐ์† ์œ ์ง€ํ•˜๊ณ  ์žˆ๋Š” ๋Œ€๊ตฌ๊ตญ์ œ๋งˆ๋ผํ†ค๋Œ€ํšŒ!</a>
                                <a href="#" class="category_link">๋งˆ๋ผํ†ค</a>
                                <span class="like"><span class="blind">์ข‹์•„์š”</span>99,999</span>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="img_wrap">
                            <a href="#" class="item_link">
                                <img src="./img/thumb_sub.jpg" alt="">
                                <span class="time"><span class="blind">์žฌ์ƒ์‹œ๊ฐ„</span>99:99</span>
                            </a>
                            <a href="#" class="watch_later_link"><span class="blind">๋‚˜์ค‘์— ๋ณด๊ธฐ</span></a>
                        </div>
                        <div class="info_wrap">
                            <div class="rank">
                                <span class="num"><span class="blind">๋žญํ‚น</span>7</span>
                                <span class="change up">3<span class="blind">์ƒ์Šน</span></span>
                            </div>
                            <div class="info">
                                <a href="#" class="title">๊ตญ์ œ์œก์ƒ๊ฒฝ๊ธฐ์—ฐ๋งน์œผ๋กœ๋ถ€ํ„ฐ ๋ผ๋ฒจ์„ ๋ถ€์—ฌ๋ฐ›์€ ๊ตญ๋‚ด์˜ ๋‹จ ๋‘ ๊ฐœ์˜ ๋งˆ๋ผํ†ค ๋Œ€ํšŒ ์ค‘ ์‹ค๋ฒ„๋ผ๋ฒจ์„ 5๋…„ ์—ฐ์† ์œ ์ง€ํ•˜๊ณ  ์žˆ๋Š” ๋Œ€๊ตฌ๊ตญ์ œ๋งˆ๋ผํ†ค๋Œ€ํšŒ!</a>
                                <a href="#" class="category_link">๋งˆ๋ผํ†ค</a>
                                <span class="like"><span class="blind">์ข‹์•„์š”</span>99,999</span>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="img_wrap">
                            <a href="#" class="item_link">
                                <img src="./img/thumb_sub.jpg" alt="">
                                <span class="time"><span class="blind">์žฌ์ƒ์‹œ๊ฐ„</span>99:99</span>
                            </a>
                            <a href="#" class="watch_later_link"><span class="blind">๋‚˜์ค‘์— ๋ณด๊ธฐ</span></a>
                        </div>
                        <div class="info_wrap">
                            <div class="rank">
                                <span class="num"><span class="blind">๋žญํ‚น</span>8</span>
                                <span class="change up">3<span class="blind">์ƒ์Šน</span></span>
                            </div>
                            <div class="info">
                                <a href="#" class="title">๊ตญ์ œ์œก์ƒ๊ฒฝ๊ธฐ์—ฐ๋งน์œผ๋กœ๋ถ€ํ„ฐ ๋ผ๋ฒจ์„ ๋ถ€์—ฌ๋ฐ›์€ ๊ตญ๋‚ด์˜ ๋‹จ ๋‘ ๊ฐœ์˜ ๋งˆ๋ผํ†ค ๋Œ€ํšŒ ์ค‘ ์‹ค๋ฒ„๋ผ๋ฒจ์„ 5๋…„ ์—ฐ์† ์œ ์ง€ํ•˜๊ณ  ์žˆ๋Š” ๋Œ€๊ตฌ๊ตญ์ œ๋งˆ๋ผํ†ค๋Œ€ํšŒ!</a>
                                <a href="#" class="category_link">๋งˆ๋ผํ†ค</a>
                                <span class="like"><span class="blind">์ข‹์•„์š”</span>99,999</span>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="img_wrap">
                            <a href="#" class="item_link">
                                <img src="./img/thumb_sub.jpg" alt="">
                                <span class="time"><span class="blind">์žฌ์ƒ์‹œ๊ฐ„</span>99:99</span>
                            </a>
                            <a href="#" class="watch_later_link"><span class="blind">๋‚˜์ค‘์— ๋ณด๊ธฐ</span></a>
                        </div>
                          <div class="info_wrap">
                            <div class="rank">
                                <span class="num"><span class="blind">๋žญํ‚น</span>9</span>
                                <span class="change up">3<span class="blind">์ƒ์Šน</span></span>
                            </div>
                            <div class="info">
                                <a href="#" class="title">๊ตญ์ œ์œก์ƒ๊ฒฝ๊ธฐ์—ฐ๋งน์œผ๋กœ๋ถ€ํ„ฐ ๋ผ๋ฒจ์„ ๋ถ€์—ฌ๋ฐ›์€ ๊ตญ๋‚ด์˜ ๋‹จ ๋‘ ๊ฐœ์˜ ๋งˆ๋ผํ†ค ๋Œ€ํšŒ ์ค‘ ์‹ค๋ฒ„๋ผ๋ฒจ์„ 5๋…„ ์—ฐ์† ์œ ์ง€ํ•˜๊ณ  ์žˆ๋Š” ๋Œ€๊ตฌ๊ตญ์ œ๋งˆ๋ผํ†ค๋Œ€ํšŒ!</a>
                                <a href="#" class="category_link">๋งˆ๋ผํ†ค</a>
                                <span class="like"><span class="blind">์ข‹์•„์š”</span>99,999</span>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="img_wrap">
                            <a href="#" class="item_link">
                                <img src="./img/thumb_sub.jpg" alt="">
                                <span class="time"><span class="blind">์žฌ์ƒ์‹œ๊ฐ„</span>99:99</span>
                            </a>
                            <a href="#" class="watch_later_link"><span class="blind">๋‚˜์ค‘์— ๋ณด๊ธฐ</span></a>
                        </div>
                        <div class="info_wrap">
                            <div class="rank">
                                <span class="num"><span class="blind">๋žญํ‚น</span>10</span>
                                <span class="change up">3<span class="blind">์ƒ์Šน</span></span>
                            </div>
                            <div class="info">
                                <a href="#" class="title">๊ตญ์ œ์œก์ƒ๊ฒฝ๊ธฐ์—ฐ๋งน์œผ๋กœ๋ถ€ํ„ฐ ๋ผ๋ฒจ์„ ๋ถ€์—ฌ๋ฐ›์€ ๊ตญ๋‚ด์˜ ๋‹จ ๋‘ ๊ฐœ์˜ ๋งˆ๋ผํ†ค ๋Œ€ํšŒ ์ค‘ ์‹ค๋ฒ„๋ผ๋ฒจ์„ 5๋…„ ์—ฐ์† ์œ ์ง€ํ•˜๊ณ  ์žˆ๋Š” ๋Œ€๊ตฌ๊ตญ์ œ๋งˆ๋ผํ†ค๋Œ€ํšŒ!</a>
                                <a href="#" class="category_link">๋งˆ๋ผํ†ค</a>
                                <span class="like"><span class="blind">์ข‹์•„์š”</span>99,999</span>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="img_wrap">
                            <a href="#" class="item_link">
                                <img src="./img/thumb_sub.jpg" alt="">
                                <span class="time"><span class="blind">์žฌ์ƒ์‹œ๊ฐ„</span>99:99</span>
                            </a>
                            <a href="#" class="watch_later_link"><span class="blind">๋‚˜์ค‘์— ๋ณด๊ธฐ</span></a>
                        </div>
                        <div class="info_wrap">
                            <div class="rank">
                                <span class="num"><span class="blind">๋žญํ‚น</span>11</span>
                                <span class="change up">3<span class="blind">์ƒ์Šน</span></span>
                            </div>
                            <div class="info">
                                <a href="#" class="title">๊ตญ์ œ์œก์ƒ๊ฒฝ๊ธฐ์—ฐ๋งน์œผ๋กœ๋ถ€ํ„ฐ ๋ผ๋ฒจ์„ ๋ถ€์—ฌ๋ฐ›์€ ๊ตญ๋‚ด์˜ ๋‹จ ๋‘ ๊ฐœ์˜ ๋งˆ๋ผํ†ค ๋Œ€ํšŒ ์ค‘ ์‹ค๋ฒ„๋ผ๋ฒจ์„ 5๋…„ ์—ฐ์† ์œ ์ง€ํ•˜๊ณ  ์žˆ๋Š” ๋Œ€๊ตฌ๊ตญ์ œ๋งˆ๋ผํ†ค๋Œ€ํšŒ!</a>
                                <a href="#" class="category_link">๋งˆ๋ผํ†ค</a>
                                <span class="like"><span class="blind">์ข‹์•„์š”</span>99,999</span>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="img_wrap">
                            <a href="#" class="item_link">
                                <img src="./img/thumb_sub.jpg" alt="">
                                <span class="time"><span class="blind">์žฌ์ƒ์‹œ๊ฐ„</span>99:99</span>
                            </a>
                            <a href="#" class="watch_later_link"><span class="blind">๋‚˜์ค‘์— ๋ณด๊ธฐ</span></a>
                        </div>
                        <div class="info_wrap">
                            <div class="rank">
                                <span class="num"><span class="blind">๋žญํ‚น</span>12</span>
                                <span class="change up">3<span class="blind">์ƒ์Šน</span></span>
                            </div>
                            <div class="info">
                                <a href="#" class="title">๊ตญ์ œ์œก์ƒ๊ฒฝ๊ธฐ์—ฐ๋งน์œผ๋กœ๋ถ€ํ„ฐ ๋ผ๋ฒจ์„ ๋ถ€์—ฌ๋ฐ›์€ ๊ตญ๋‚ด์˜ ๋‹จ ๋‘ ๊ฐœ์˜ ๋งˆ๋ผํ†ค ๋Œ€ํšŒ ์ค‘ ์‹ค๋ฒ„๋ผ๋ฒจ์„ 5๋…„ ์—ฐ์† ์œ ์ง€ํ•˜๊ณ  ์žˆ๋Š” ๋Œ€๊ตฌ๊ตญ์ œ๋งˆ๋ผํ†ค๋Œ€ํšŒ!</a>
                                <a href="#" class="category_link">๋งˆ๋ผํ†ค</a>
                                <span class="like"><span class="blind">์ข‹์•„์š”</span>99,999</span>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="img_wrap">
                            <a href="#" class="item_link">
                                <img src="./img/thumb_sub.jpg" alt="">
                                <span class="time"><span class="blind">์žฌ์ƒ์‹œ๊ฐ„</span>99:99</span>
                            </a>
                            <a href="#" class="watch_later_link"><span class="blind">๋‚˜์ค‘์— ๋ณด๊ธฐ</span></a>
                        </div>
                        <div class="info_wrap">
                            <div class="rank">
                                <span class="num"><span class="blind">๋žญํ‚น</span>13</span>
                                <span class="change up">3<span class="blind">์ƒ์Šน</span></span>
                            </div>
                            <div class="info">
                                <a href="#" class="title">๊ตญ์ œ์œก์ƒ๊ฒฝ๊ธฐ์—ฐ๋งน์œผ๋กœ๋ถ€ํ„ฐ ๋ผ๋ฒจ์„ ๋ถ€์—ฌ๋ฐ›์€ ๊ตญ๋‚ด์˜ ๋‹จ ๋‘ ๊ฐœ์˜ ๋งˆ๋ผํ†ค ๋Œ€ํšŒ ์ค‘ ์‹ค๋ฒ„๋ผ๋ฒจ์„ 5๋…„ ์—ฐ์† ์œ ์ง€ํ•˜๊ณ  ์žˆ๋Š” ๋Œ€๊ตฌ๊ตญ์ œ๋งˆ๋ผํ†ค๋Œ€ํšŒ!</a>
                                <a href="#" class="category_link">๋งˆ๋ผํ†ค</a>
                                <span class="like"><span class="blind">์ข‹์•„์š”</span>99,999</span>
                            </div>
                        </div>
                    </li>
                </ol>
        </div>
    </div>
</body>
</html>
@charset "UTF-8";

/* ๊ธฐ๋ณธ ์Šคํƒ€์ผ */
body {
    font-family: Dotum,'๋‹์›€', Helvetica, sans-serif;
    font-size: 15px;
    line-height: 18px;
    color: #3c3c3c;
}
a {
    color: inherit;
    text-decoration: none;
    vertical-align: top;
}
img {
    vertical-align: top;
}
.blind {
    overflow: hidden;
    position: absolute;
    clip: rect(0 0 0 0);
    width: 1px;
    height: 1px;
    margin: -1px;
}

/* ์Šคํƒ€์ผ ์„ ์–ธ */
h1 {
    overflow: hidden;
    width: 1000px;
    margin: 0 auto;
    padding: 20px 0;
    line-height: 38px;
    font-size: 26px;
    color: #000;
}
.main_wrap {
    background-color: #ececec;
}
.main_wrap .content {
    position: relative;
    width: 1000px;
    margin: 0 auto;
    padding: 50px 0 20px;
}
.main_wrap .noti_txt {
    position: absolute;
    top: 20px;
    right: 0;
    font-size: 12px;
    color: #7c7c7c;
}
.main_list:after {
    display: block;
    content: '';
    clear: both;
}
.main_list li {
    float: left;
}
.main_list li + li {
    margin-left: 17px;
}
.main_list li .item_link {
    position: relative;
    display: block;
}
.main_list .img_box {
    position: relative;
}
.main_list .img_box:after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    content: '';
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.05);
}
.main_list .img_box img {
    width: 322px;
    height: 215px;
}
.main_list .info_wrap {
    position: absolute;
    right: 15px;
    bottom: 15px;
    left: 15px;
    color: #fff;
    overflow: hidden;
}
.main_list .info {
    margin-left: 40px;
}
.main_list .rank {
    position: absolute;
    top: -5px;
    text-align: center;
}
.main_list .rank .num {
    display: block;
    font-size: 40px;
    line-height: 42px;
}
.main_list .rank .change {
    display: block;
    margin-top: 11px;
}
.main_list .rank .change:before {
    display: inline-block;
    content: '';
    margin-right: 3px;
}
.rank .up {
    color: #f82850;
}
.rank .down {
    color: #1996ff;
}
.rank .up:before {
    width: 7px;
    height: 10px;
    background: url(./img/rank_up.png) no-repeat;
}
.rank .down:before {
    width: 7px;
    height: 10px;
    background: url(./img/rank_down.png) no-repeat;
}
.rank .keep:before {
    width: 8px;
    height: 2px;
    padding-bottom: 4px;
    background: url(./img/rank_keep.png) no-repeat;
}
.main_list .category {
    font-size: 14px;
}
.main_list .title {
    margin-top: 3px;
    font-size: 18px;
    line-height: 22px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.main_list .like {
    position: relative;
    display: block;
    margin-top: 5px;
    padding-left: 18px;
    font-size: 14px;
    line-height: 20px;
}
.main_list .like:before {
    position: absolute;
    top: 3px;
    left: 0;
    content: '';
    width: 14px;
    height: 15px;
    background: url(./img/like_large.png) no-repeat;
}
.sub_wrap {
    margin-top: 30px;
}
.sub_list {
    width: 1000px;
    margin: 0 auto;
}
.sub_list:after {
    display: block;
    content: '';
    clear: both;
}
.sub_list li {
    float: left;
    width: 188px;
    margin-bottom: 40px;
}
.sub_list li + li {
    margin-left: 15px;
}
.sub_list li:nth-child(5n+1) {
    margin-left: 0;
}
.sub_list .img_wrap {
    position: relative;
}
.sub_list .item_link {
    display: block;
    position: relative; /*๋ถ€๋ชจ ์š”์†Œ*/
}
.sub_list .item_link:after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    content: '';
    border: 1px solid rgba(0, 0, 0, 0.03);
}
.sub_list .item_link img {
    width: 188px;
    height: 141px;
}
.sub_list .time {
    position: absolute;
    right: 4px;
    bottom: 4px;
    height: 18px;
    padding: 0 7px 0;
    font-size: 11px;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.7);
}
.sub_list .watch_later_link {
    display: none;
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 45px;
    height: 45px;
    background: url(./img/later_watch.png) no-repeat 0 0;
}
/*a์— hover๊ฐ€ ์•„๋‹Œ ๋ถ€๋ชจ ์š”์†Œ์— hover ๊ฑธ์–ด์•ผํ•จ*/
.sub_list .img_wrap:hover .watch_later_link {
    display: block;
}
.sub_list .img_wrap:hover .time {
    display: none;
}
.sub_list .info_wrap {
    margin-top: 10px;
    position: relative;
}
.sub_list .info {
    height: 79px;
    margin-left: 30px;
}
.sub_list .title {
    display: -webkit-box;
    overflow: hidden;
    max-height: 36px;
    font-size: 15px;
    line-height: 18px;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    word-break: break-all;
    color: #090909;
}
.sub_list .category_link {
    display: block;
    padding-top: 3px;
    font-size: 12px;
    color: #7ba7df;
}
.sub_list .rank {
    position: absolute;
    top: 0;
    bottom: 1px;
    width: 20px;
    text-align: center;
}
.sub_list .rank .num {
    display: block;
    font-size: 22px;
    line-height: 24px;
}
.sub_list .rank .change {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
}
.sub_list .rank .change:before {
    display: inline-block;
    content: '';
    margin-right: 3px;
}
.sub_list .like {
    position: absolute;
    bottom: 0;
    padding-left: 18px;
    font-size: 14px;
    line-height: 20px;
}
.sub_list .like:before {
    position: absolute;
    top: 6px;
    left: 0;
    content: '';
    width: 11px;
    height: 10px;
    background: url(./img/like.png) no-repeat;
}

์ •๋ฆฌ

  • ์•„์ด์ฝ˜ ์ƒํƒœ ๋ณ€๊ฒฝ : background, :before
    ๊ฐ€์ƒ์„ ํƒ์ž ๋ถ€๋ถ„์— ์ด๋ฏธ์ง€๊ฐ€ ๋…ธ์ถœ๋˜๋„๋ก
  • ์˜ค๋ฒ„ ์‹œ ๋ฒ„ํŠผ ๋…ธ์ถœ display, position, :hover
post-custom-banner

0๊ฐœ์˜ ๋Œ“๊ธ€