본문 바로가기

Programming/Web Programming (2021)

[웹프로그래밍 실습] 6. CSS 기초

반응형

1-2. CSS 작성과 실행

<!DOCTYPE html>
<html lang="en">
<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 Basic</title>
</head>
<body>
    <h2> CSS Basic</h2>
    <hr>
    CSS Basic Example
</body>
</html>


1-3. CSS 포함방법 3가지

<!DOCTYPE html>
<html lang="en">
<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>Example 1-3</title>
    <style>
        h2{
            color:darkorange;
        }
    </style>
    <link rel="stylesheet" type="text/css" href="1-3.css">
</head>
<body>
    <h2 style="color:fuchsia">Inline stylesheet</h2>
    <hr>
    <h2>Embedded stylesheet</h2>
    <hr>
    <h2 class="red">External stylesheet</h2>
    
</body>
</html>
.red{
    color:red;
}

반응형