πŸ’»Coding/πŸ“’ CSS

css _문법 + (css 맛보기)

μŒμ€μ‘ 2021. 8. 23. 06:59
728x90
λ°˜μ‘ν˜•

CSS _문법 + (CSS 맛보기

CSS - 문법

- CSS의 문법 ν˜•μ‹μ€ μ„ νƒμž, 속성, μ†μ„±κ°’μœΌλ‘œ 이루어져 μžˆμŠ΅λ‹ˆλ‹€.


- μž‘μ„±μ€ μ™ΈλΆ€ μŠ€νƒ€μΌμ‹œνŠΈ, λ‚΄λΆ€ μŠ€νƒ€μΌμ‹œνŠΈ 그리고 인라인 μŠ€νƒ€μΌλ‘œ μž‘μ„±μ΄ κ°€λŠ₯ν•©λ‹ˆλ‹€.
γ„΄ 보톡 μˆ˜μ •μ΄ μš©μ΄ν•˜κ³  νš¨μœ¨μ„ μœ„ν•΄ μ™ΈλΆ€ μŠ€νƒ€μΌ μ‹œνŠΈμ— μž‘μ„± ν›„,
HTML νŒŒμΌμ— μ—°κ²°ν•˜λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€.

 

[ CSS - 문법 ]

<style>
    μ„ νƒμž { 속성1: 속성값; 속성2: 속성값; }
</style>

css - style - ν˜•μ‹

 

 

[CSS - <h2>νƒœκ·Έμ— μŠ€νƒ€μΌ μ μš©ν•˜κΈ° ]

γ„΄ <h2>νƒœκ·Έμ— μž‘μ„±ν•œ κΈ€μžμ˜ 색깔을 λ°”κΏ”λ³ΌκΉŒμš”?

HTML만 μž‘μ„± → κΈ€μžμƒ‰μ˜ λ³€ν™” μ—†μŒ

<!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>css문법_맛보기</title>
</head>
<body>
    <h2>
        CSSλ₯Ό μ‹œμž‘ν•˜μ‹  것을 ν™˜μ˜ν•©λ‹ˆλ‹€.
    </h2>
</body>
</html>

CSS 적용 μ „ ν™”λ©΄

 

 

 

 

CSS stlye 적용 → κΈ€μžμƒ‰μ΄ 변함

(↓속성에 λŒ€ν•΄μ„œλŠ” λ‚˜μ€‘에 μžμ„Ένžˆ λ°°μšΈν…Œλ‹ˆ, "μ˜€λŠ˜μ€ 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>css문법_맛보기</title>
    <style>
        h2 {
            color: red;
        }
    </style>
</head>
<body>
    <h2>
        CSSλ₯Ό μ‹œμž‘ν•˜μ‹  것을 ν™˜μ˜ν•©λ‹ˆλ‹€.
    </h2>
</body>
</html>

 

[ μ‹€ν–‰μ‹œ ν™”λ©΄ ]

css둜 κΈ€μžμƒ‰ λ³€ν™”

728x90
λ°˜μ‘ν˜•