๐Ÿ’ปCoding/๐Ÿ“’ CSS

CSS _ํฐํŠธ(font)_font-family

์Œ์€์‘ 2021. 11. 22. 11:48
728x90
๋ฐ˜์‘ํ˜•

CSS _ํฐํŠธ(font)_font-family

font๋Š” ํฐํŠธ ์Šคํƒ€์ผ์„ ๋ฐ”๊พธ๊ธฐ ์œ„ํ•œ ์†์„ฑ๋ช…์œผ๋กœ font-()๋’ค์˜ ๋‚ด์šฉ์— ๋”ฐ๋ผ
ํฐํŠธ์˜ ์Šคํƒ€์ผ์— ๋ณ€ํ™”๋ฅผ ์ค„ ์ˆ˜ ์žˆ์Œ!

[ CSS - font ๋ฌธ๋ฒ• ]

<style>
    ์„ ํƒ์ž { font-์†์„ฑ: ์†์„ฑ๊ฐ’; }
</style>

 

โ–ถ CSS์—์„œ ์ž์ฃผ ์‚ฌ์šฉํ•˜๋Š” font์˜ ์†์„ฑ์ž…๋‹ˆ๋‹ค.

โ–ถ font-family
ใ„ด ํฐํŠธ์˜ ๊ธ€๊ผด์„ ์„ค์ •
ใ„ด ์†์„ฑ๊ฐ’์ด ์—ฌ๋Ÿฌ ๊ฐœ์˜ ๊ธ€๊ผด๋กœ ์„ค์ •๋˜์–ด ์žˆ์œผ๋ฉด, ์ ํ˜€์žˆ๋Š” ์ˆœ์„œ๋Œ€๋กœ ๊ธ€๊ผด์„ ์ ์šฉ
โ€ป ์—ฌ๋Ÿฌ ๊ฐœ์˜ ๊ธ€๊ผด์„ ๋‚˜์—ดํ•  ๋•Œ์—๋Š” ์‰ผํ‘œ(,)๋กœ ๊ตฌ๋ถ„

โ–ถ font-family ์‚ฌ์šฉ ๋ฐฉ๋ฒ•

<style>
    ์„ ํƒ์ž { font-family: ๊ธ€๊ผด์ข…๋ฅ˜; }
</style>

 

โ–ถ font-family ์‹ค์ „ ์˜ˆ์‹œ

[ html - css ์ž‘์„ฑ ์ฝ”๋“œ ]

<!DOCTYPE html>
<html lang="ko">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>font-family</title>
    <style>
        .family1 { font-family: "Times New Roman", Times, serif; }
        /* ๊ธ€๊ผด์ด ๋„์–ด์“ฐ๊ธฐ๊ฐ€ ์žˆ๋Š”๊ฒฝ์šฐ""๋ฅผ ์‚ฌ์šฉํ•ด์„œ ์ž‘์„ฑ */
		.family2 { font-family: Arial, Helvetica, sans-serif; }
    </style>
</head>
<body>
    <h1>font-family</h1>
    <h3>font-family : ํฐํŠธ์˜ ๊ธ€๊ผด์„ ์„ค์ •ํ•˜๋Š” ์†์„ฑ</h3>
	<p class="family1">Times New Roman ๊ธ€๊ผด ์ ์šฉ</p>
	<p class="family2">Arial ๊ธ€๊ผด ์ ์šฉ</p>
</body>
</html>

 

[ ์‹คํ–‰ ํ™”๋ฉด์˜ ๋ณ€ํ™” ] 

↓ css style ์ ์šฉ ํ™”๋ฉด

↑css style ์ ์šฉ ์ „ ํ™”๋ฉด

↓ css style ์ ์šฉ ํ™”๋ฉด

↑css style ์ ์šฉ  ํ™”๋ฉด

 

728x90
๋ฐ˜์‘ํ˜•