CSS 적용하기

Grace Goh·2022년 9월 4일
0

Cascading Style Sheet

<div> 등에 class로 네이밍 (<h1> <p> 등도 가능)
<head> 안에 <style> 열어서
.mytitle {...}로 작성

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>로그인 페이지</title>
    <link href="https://fonts.googleapis.com/css2?family=Do+Hyeon&display=swap" rel="stylesheet">
    <style>
        * {
            font-family: 'Do Hyeon', sans-serif;
        }
        .mytitle {
            width: 300px;
            height: 200px;
            color: white;

            text-align: center;

            background-image: url("https://img1.yna.co.kr/photo/yna/YH/2021/12/28/PYH2021122804370001300_P4.jpg");
            background-size: cover;
            background-position: center;

            border-radius: 10px;

            padding-top: 40px;
        }
        .wrap {
            width: 300px;
            margin: auto;
        }
    </style>
</head>
<body>
    <div class="wrap">
        <div class="mytitle">
            <h1>대랑이 전용 내 마음속에 로그인</h1>
            <h5>아이디, 비밀번호를 입력해주세요.</h5>
        </div>
        <p>ID: <input type="text"/></p>
        <p>PW: <input type="text"/></p>
        <button>로그인하기</button>
    </div>
</body>
</html>

CSS 파일 분리

(style).css 파일을 같은 폴더에 만들고
<head>에 불러오기

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>로그인 페이지</title>
    <link href="https://fonts.googleapis.com/css2?family=Do+Hyeon&display=swap" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="style.css">
</head>
profile
Español, Inglés, Coreano y Python

0개의 댓글