๐ ์ฒซ ๋ฒ์งธ ๋ฌธ์ : ๊ฐ๋จํ ํ๋กํ ์นด๋ ๋ง๋ค๊ธฐ
๋ค์ ์๊ตฌ์ฌํญ์ ๋ง์กฑํ๋ HTML ๋ฐ CSS ์ฝ๋๋ฅผ ์์ฑํด ๋ณด์ธ์.
์๊ตฌ์ฌํญ
- HTML ๊ตฌ์กฐ:
- <div class="profile-card">๋ฅผ ์ต์์ ์ปจํ ์ด๋๋ก ์ฌ์ฉํฉ๋๋ค.
- ์ปจํ ์ด๋ ์์ <h1> ํ๊ทธ๋ก ์ด๋ฆ์ ๋ฃ์ต๋๋ค (์: 'ํ๊ธธ๋').
- <p> ํ๊ทธ๋ก ์ง์ /์ญํ ์ ๋ฃ์ต๋๋ค (์: '์น ๊ฐ๋ฐ์').
- <img> ํ๊ทธ๋ฅผ ์ฌ์ฉํ์ฌ ํ๋กํ ์ด๋ฏธ์ง๋ฅผ ๋ฃ์ต๋๋ค. ์ด๋ฏธ์ง URL์ ์์์ ๊ฒ์ ์ฌ์ฉํด๋ ๋ฉ๋๋ค
- CSS ์คํ์ผ:
- .profile-card ํด๋์ค์ ๋ค์ ์คํ์ผ์ ์ ์ฉํฉ๋๋ค:
- ๋๋น: 300px
- ํ ๋๋ฆฌ: 1px solid #ccc
- ํจ๋ฉ: 20px
- ํ ์คํธ ์ค์ ์ ๋ ฌ: text-align: center
- ๋ฐฐ๊ฒฝ์: #f9f9f9
- ๋ชจ์๋ฆฌ ๋ฅ๊ธ๊ฒ: border-radius: 8px
- img ํ๊ทธ์ ๋ค์ ์คํ์ผ์ ์ ์ฉํฉ๋๋ค:
- ๋๋น์ ๋์ด: 100px
- ๋ชจ์: ์ํ (border-radius: 50%)
- ์ด๋ฏธ์ง ์์ 1px ์ค์ ๊ฒ์์ ํ ๋๋ฆฌ (border: 1px solid #000)๋ฅผ ์ถ๊ฐํฉ๋๋ค.
- .profile-card ํด๋์ค์ ๋ค์ ์คํ์ผ์ ์ ์ฉํฉ๋๋ค:
๋๋ณด๊ธฐ
์ ์๋ชป์ดํดํ์ด
ํ๊ธธ๋
์น ๊ฐ๋ฐ์
์ ์๋ชป์ดํดํ์ด
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Docuent</title>
<style>
.profile-card {
padding: 20px;
width: 300px;
background-color: #f9f9f9;
border: 1px solid #ccc;
border-radius: 8px;
text-align: center;
}
.profile-card img {
padding-top: 1rem;
margin-top: 1rem;
width: 100px;
aspect-ratio: 1/1;
border-radius: 50%;
border-top: 1px solid #000
}
</style>
</head>
<body>
<div class="profile-card">
<h1>ํ๊ธธ๋</h1>
<p>์น ๊ฐ๋ฐ์</p>
<img src="https://via.placeholder.com/150" alt="ํ๋กํ ์ฌ์ง">
</div>
</body>
</html>
