<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>로그인페이지</title>
<style>
.login {
background:yellow;
width: 300px;
height: 200px;
color:white;
text-align: center;
background-image: url("https://www.ancient-origins.net/sites/default/files/field/image/Agesilaus-II-cover.jpg");
background-size: cover;
background-position: center;
<!-- 박스안에 이미지를 제대로 넣고 싶을 때-->
border-radius: 10px;
padding-top:20px;
}
.wrap {
width: 300px;
margin: auto;
<!-- width 값을 한정하고 margin을 자동으로 하면 가로로 가운데 정렬이 된다-->
}
.btn {
width: 90px;
margin: auto;
display:block;
<!-- HTML은 글속성과 박스속성이 있는데,글속성은 가로,세로의 기준이 없어서 글속성에서 박스속성으로 바꿔줘야한다 -->
}
</style>
</head>
<body>
<div class = "wrap">
<div class = "login">
<h1>로그인 페이지</h1>
<h5>아이디, 패스워드를 입력해주헤요.</h5>
</div>
<p>ID: <input type="text"/></p>
<p>PW: <input type="text"/></p>
<button class = "btn">로그인하기</button>
</div>
</body>
</html>
background-image: url("https://www.ancient-origins.net/sites/default/files/field/image/Agesilaus-II-cover.jpg");
background-size: cover;
background-position: center;