CSS : ํ…์ŠคํŠธ ์Šคํƒ€์ผ๋ง ์†์„ฑ๋“ค

2025. 7. 28. 15:06ใ†Style/CSS

๋ฐ˜์‘ํ˜•

gptํ•œํ…Œ ๊ทธ๋ ค๋‹ฌ๋ผ๊ณ  ํ•ด๋ดค๋‹ค. ์Œ...

๋ชฉ์ฐจ

1. color : ๊ธ€์ž์ƒ‰

2. font-size : ๊ธ€์ž ํฌ๊ธฐ

3. font-family : ๊ธ€๊ผด

4. fon-weight : ๊ธ€์ž ๊ตต๊ธฐ

5. line-height : ์ค„ ๋†’์ด

6. text-decoration : ํ…์ŠคํŠธ ๊พธ๋ฏธ๊ธฐ


1. color : ๊ธ€์ž์ƒ‰

๊ธ€์ž์ƒ‰์„ ์ง€์ •ํ•˜๋Š” ์†์„ฑ์ด๋‹ค. text, font ๊ฐ™์€ ๊ฑฐ ์•ˆ๋ถ™์ด๊ณ  ๋‹จ์ˆœํžˆ color๋งŒ ์‚ฌ์šฉํ•œ๋‹ค.

์—ฌ๋Ÿฌ ์ƒ‰์ƒ ๋‹จ์œ„๋กœ ์†์„ฑ๊ฐ’์„ ์ง€์ •ํ•œ๋‹ค.

.red-text {
	color: red;
}

.blue-text {
	color: #0000ff;
}

.green-text {
	color: rgb(0,255,0);
}


2. font-size : ๊ธ€์ž ํฌ๊ธฐ

๊ธ€์ž ํฌ๊ธฐ๋ฅผ ์ง€์ •ํ•˜๋Š” ์†์„ฑ์ด๋‹ค.

์ง€์ •๋œ ํ‚ค์›Œ๋“œ ํ˜น์€ ํฌ๊ธฐ ๋‹จ์œ„๋กœ ์†์„ฑ๊ฐ’์„ ์ง€์ •ํ•œ๋‹ค.

#large-text {
    font-size: large;
}
#medium-text {
    font-size: medium;
}
#small-text {
    font-size: small;
}
#px-text {
    font-size: 10px;
}
#em-text {
    font-size: 2em;
}
#rem-text {
    font-size: 2rem;
}


3. font-family : ๊ธ€๊ผด

์‚ฌ์šฉํ•˜๊ณ  ์‹ถ์€ ๊ธ€๊ผด์„ ๋‹ค์šด๋ฐ›์•„์„œ ์‚ฌ์šฉํ•  ์ˆ˜๋„ ์žˆ๊ณ , ๊ธฐ๋ณธ์œผ๋กœ ์‚ฌ์šฉ๊ฐ€๋Šฅํ•œ ๊ธ€๊ผด๋“ค ์ค‘ ๊ณจ๋ผ์„œ ์‚ฌ์šฉํ•  ์ˆ˜๋„ ์žˆ๋‹ค.

#font-courier {
    font-family: 'Courier New', Courier, monospace;
}
#font-georgia {
    font-family: Georgia, 'Times New Roman', Times, serif;
}

 


4. font-weight : ๊ธ€์ž ๊ตต๊ธฐ

์ง€์ •๋œ ํ‚ค์›Œ๋“œ ๋ฐ 100๋‹จ์œ„ ์ˆซ์ž๋กœ 100~900์„ ์†์„ฑ๊ฐ’์œผ๋กœ ์‚ฌ์šฉํ•œ๋‹ค.

#_bold {
    font-weight: bold;
}
#_100 {
    font-weight: 100;
}
#_500 {
    font-weight: 500;
}
#_900 {
    font-weight: 900;
}

 


5. line-height : ์ค„ ๋†’์ด

ํ…์ŠคํŠธ ์‚ฌ์ด ๊ฐ„๊ฒฉ์„ ์กฐ์ ˆํ•  ๋•Œ ์‚ฌ์šฉํ•œ๋‹ค.

๋‹จ์œ„๋กœ ์ง์ ‘ ์ž…๋ ฅํ•  ์ˆ˜๋„ ์žˆ์ง€๋งŒ

๋‹จ์ˆœ ์ˆซ์ž๋งŒ ์ž…๋ ตํ•  ๊ฒฝ์šฐ, ํ•ด๋‹น ์ˆซ์ž๋ฅผ font-size์— ๊ณฑํ•˜๋Š” ์‹์œผ๋กœ ๋“ค์–ด๊ฐ„๋‹ค.

#_3px {
    line-height: 3px;
}
#_1 {
    line-height: 1;
}
#_2 {
    line-height: 2;
}


6. text-decoration : ํ…์ŠคํŠธ ๊พธ๋ฏธ๊ธฐ

ํ…์ŠคํŠธ์— ๋ฐ‘์ค„์„ ๋„ฃ๊ฑฐ๋‚˜ ์ทจ์†Œ์„ ์„ ๋„ฃ๋Š” ๋“ฑ์˜ ๊ฒฝ์šฐ์— ์‚ฌ์šฉํ•œ๋‹ค.

none์˜ ๊ฒฝ์šฐ, ๊ธฐ๋ณธ์ ์œผ๋กœ ๋ฐ‘์ค„์ด ๋“ค์–ด๊ฐ€๋Š” ํƒœ๊ทธ (<a>)์—์„œ ๋ฐ‘์ค„์„ ์—†์•จ ๋•Œ ๋งŽ์ด ์‚ฌ์šฉํ•œ๋‹ค.

#_none {
    text-decoration: none;
}
#_underline {
    text-decoration: underline;
}
#_line-through {
    text-decoration: line-through;
}

 

 

 

 

 

 

 

์ฐธ๊ณ 

๋”๋ณด๊ธฐ

codeit ๊ฐ•์˜

๋ฐ˜์‘ํ˜•