<head> <title>나영 페이지</title> </head>

<body> 나의 첫번째 웹페이지! </body>

<body>
<h1>로그인 페이지</h1>
<p>ID : <input type="text" /></p>
<p>PW : <input type="text" /></p>
<button>로그인 하기</button>
</body>
태그 없이 적어준다면 줄바꿈이 되지 않은 상태로 결과가 나오기 때문에 필수로 사용해야됨!!

<h1 class="mytitle">로그인 페이지</h1>
<style> .mytitle { color : red; } </style>
h1의 class 이름인 mytitle을 적어주는데 그 앞에 .을 꼭 붙여줘야함!!!
글자의 색을 빨간색으로 지정하고 싶다면
결과

박스 나오면 무조건 div
구역은
margin : 내 바깥쪽으로 여백을 줌(시계 방향으로 값을 지정)

margin : 20px 20px 20px 20px을 주면 아래와 같은 결과가 나옴

padding : 내 안쪽으로 여백을 줌(시계 방향으로 값을 지정)

padding : 20px 20px 20px 20px을 주면 아래와 같은 결과가 나옴

<!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>Document</title> <style> .mytitle { background-color: green; width : 300px; height: 200px; border-radius: 10px; color : white; text-align: center; padding : 30px 0px 0px 0px; background-image: url('https://www.ancient-origins.net/sites/default/files/field/image/Agesilaus-II-cover.jpg'); background-position: center; background-size: cover; } </style> </head> <body> <div class="mytitle"> <h1>로그인 페이지</h1> <h5>아이디, 비밀번호를 입력하세요</h5> </div> <p>ID : <input type="text" /></p> <p>PW : <input type="text" /></p> <button class="mybtn">로그인 하기</button> </body> </html>

<!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>Document</title> <style> .mytitle { background-color: green; width: 300px; height: 200px; border-radius: 10px; color: white; text-align: center; padding: 30px 0px 0px 0px; background-image: url('https://www.ancient-origins.net/sites/default/files/field/image/Agesilaus-II-cover.jpg'); background-position: center; background-size: cover; } .wrap { background-color: white; width : 300px; margin : 20px auto 0px 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 class="mybtn">로그인 하기</button> </div> </body> </html>

클래스를 이동하고 옮기고 하면 정렬이 깨질 수도 있는데 이때 shift + Alt + f 를 누르면 됨
폰트, 버튼, 기타 등을 이용하고 싶을 때 참고하면 좋음 : https://fonts.google.com/?subset=korean
주석 : Ctrl + /
css 파일 분리를 하고 싶다면??
style.css 파일을 같은 폴더에 만들고, head 태그에서 불러오면 됨
예시)
<link rel="stylesheet" type="text/css" href = "(css파일이름).css">
css 파일 이름이 style이므로 href = "style.css"라고 하면 됨