λ³Έλ¬Έ λ°”λ‘œκ°€κΈ°
CSS/Layout_Site

이미지 μœ ν˜• (1)

by oranssy 2022. 8. 17.
728x90
λ°˜μ‘ν˜•

⭐️ 이미지 μœ ν˜• 01 ⭐️


01. λ ˆμ΄μ•„μ›ƒ κ΅¬μƒν•˜κΈ°

λ ˆμ΄μ•„μ›ƒμ„ ꡬ상할 λ•ŒλŠ”, μŠ€μΌ€μΉ˜ν•˜λ©΄μ„œ μ„ΈλΆ€ λ‚΄μš©μ˜ μ •λ³΄κΉŒμ§€ ꡬ체적으둜 κ³„νšν•©λ‹ˆλ‹€.

02. μƒμž(div) λ§Œλ“€κΈ° : <body>

section 을 μ‹œλ©˜ν‹± λ§ˆν¬μ—…ν•˜κ³ , id 둜 이름을 μ§€μ–΄μ€λ‹ˆλ‹€.
μΉ΄λ“œ μƒμž 3개(article)을 λ§Œλ“€κ³ , 제λͺ©κ³Ό λ‚΄μš©μ„ μž…λ ₯ν•©λ‹ˆλ‹€.
쀑간 쀑간에 λΈŒλΌμš°μ €λ₯Ό μ‚΄νŽ΄λ³΄λ©° 잘 λ§Œλ“€μ–΄μ§€κ³  μžˆλŠ”μ§€ ν™•μΈν•˜λŠ” 과정이 ν•„μš”ν•©λ‹ˆλ‹€.

<section id="imageType" class="image__wrap nexon section">
<h2>λ‚˜μ˜ 쉴 곳은 어디에</h2>
<p>우리 λͺ¨λ‘μ˜ 마음이 νŽΈμ•ˆν•΄μ§€λŠ” 힐링 μž₯μ†Œλ₯Ό μ†Œκ°œν•©λ‹ˆλ‹€.</p>
<div class="image__inner container">
<article class="image img1">
<h3 class="tit">듀꽃이 κ°€λ“ν•œ μœ μ›μ§€μ—μ„œ</h3>
<p class="desc">λ‚˜λ¬΄κ°€ ν’ˆμ–΄μ£ΌλŠ” κ·ΈλŠ˜μ— 앉아 μ‚΄λž‘μ΄λŠ” 꽃듀을 λ°”λΌλ³΄λŠ” 상상을 ν•΄λ³΄μ„Έμš”. λ‚˜λ¬΄κ°€ ν’ˆμ–΄μ£ΌλŠ” κ·ΈλŠ˜μ— 앉아 μ‚΄λž‘μ΄λŠ” 꽃듀을 λ°”λΌλ³΄λŠ” 상상을 ν•΄λ³΄μ„Έμš”. λ‚˜λ¬΄κ°€
ν’ˆμ–΄μ£ΌλŠ” κ·ΈλŠ˜μ— 앉아 μ‚΄λž‘μ΄λŠ” 꽃듀을 λ°”λΌλ³΄λŠ” 상상을 ν•΄λ³΄μ„Έμš”.</p>
<a class="btn" href="#">μžμ„Ένžˆλ³΄κΈ°</a>
</article>
<article class="image img2">
<h3 class="tit white">ν‘Έλ₯Έ λ°”λžŒμ˜ κΈΈλͺ©μ—μ„œ</h3>
<p class="desc white">μž”μž”ν•˜κ³  μ‹œμ›ν•œ λ°”λžŒμ΄ λ§ˆμŒμ„ λ‹€λ…μ΄λŠ” 그곳으둜 ν•¨κ»˜ κ°€ λ΄…μ‹œλ‹€. μž”μž”ν•˜κ³  μ‹œμ›ν•œ λ°”λžŒμ΄ λ§ˆμŒμ„ λ‹€λ…μ΄λŠ” 그곳으둜 ν•¨κ»˜ κ°€ λ΄…μ‹œλ‹€. μž”μž”ν•˜κ³  μ‹œμ›ν•œ λ°”λžŒμ΄ λ§ˆμŒμ„ λ‹€λ…μ΄λŠ” 그곳으둜 ν•¨κ»˜ κ°€ λ΄…μ‹œλ‹€.</p>
<a class="btn" href="#">μžμ„Ένžˆλ³΄κΈ°</a>
</article>
</div>
</section>

02. style(css) μ„€μ •ν•˜κΈ° : <style>

/* fonts */
@import url('https://webfontworld.github.io/NexonLv1Gothic/NexonLv1Gothic.css');
.nexon {
font-family: 'NexonLv1Gothic';
font-weight: 300;
}
/* reset */
* {
margin: 0;
padding: 0;
}
a {
text-decoration: none;
color: #000;
}
img {
width: 570px;
}
h1, h2, h3, h4, h5, h6 {
font-weight: normal;
}
/* common */
.container {
width: 1160px;
padding: 0 20px;
margin: 0 auto;
min-width: 1160;
}
.section {
padding: 120px 0;
}
.section > h2 {
font-size: 50px;
line-height: 1;
text-align: center;
margin-bottom: 20px;
}
.section > p {
font-size: 22px;
color: #666;
text-align: center;
margin-bottom: 70px;
}
/* imageType01 */
.image__wrap {}
.image__inner {
display: flex;
justify-content: space-between;
}
.image {
width: 49%;
height: 370px;
padding: 197px 30px 30px 30px;
box-sizing: border-box; /* padding 의 영ν–₯으둜 전체 λΆ€ν”Όκ°€ μ»€μ§€λŠ” 것 λ°©μ§€*/
}
.image.img1 {
background: url(img/image_bg01_01.jpg) no-repeat center / cover ;
}
.image.img2 {
background: url(img/image_bg01_02.jpg) no-repeat center / cover ;
}
.image .tit {
font-size: 32px;
margin-bottom: 10px;
}
.image .tit.white {
color: #fff
}
.image .desc {
font-size: 16px;
font-weight: 400;
line-height: 1.5;
margin-bottom: 10px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2; /* clamp μ€„λ°”κΏˆ 2쀄 이상 되면 ... 으둜 λ°”λ€œ - '3쀄 효과' κ²€μƒ‰ν•΄μ„œ μ‚¬μš© */
-webkit-box-orient: vertical;
}
.image .desc.white {
color: #fff;
}
.image .btn {
font-size: 16px;
color: #fff;
background: #755C2B;
padding: 10px 20px;
display: inline-block;
}

03. 결과보기

728x90
λ°˜μ‘ν˜•

'CSS > Layout_Site' μΉ΄ν…Œκ³ λ¦¬μ˜ λ‹€λ₯Έ κΈ€

이미지 μœ ν˜• (3)  (2) 2022.08.22
이미지 μœ ν˜• (2)  (2) 2022.08.18
μΉ΄λ“œ μœ ν˜• (3)  (8) 2022.08.11
μΉ΄λ“œ μœ ν˜• (2)  (7) 2022.08.10
μΉ΄λ“œ μœ ν˜• (1)  (8) 2022.08.09

λŒ“κΈ€