
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
안녕하세요 강사님! 1-8주차 CSS 관련해서 궁금한 사항이 있습니다.
이전에 이미지 사이즈를
width: 300px;
height: 200px;
위와 같이 맞추고 전체를 가운데로 옮기는 과정에서 만든 background-color 영역 사이즈를 똑같이 [ width: 300px; ]로 설정해두었는데 첫 번째 사진과 같이 이미지 사이즈와 일치하지 않았습니다. 오히려 [ width: 360px; ]로 수정하니 동일한 너비를 가지게 되었는데, 이러한 오류는 어떤 게 문제가 되는 걸까요?
현재 맥북 에어 M1 vs code를 사용하고 있습니다.


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.mytitle{
width: 300px;
height: 200px;
color: white;
text-align: center;
padding: 30px;
border-radius: 8px;
background-image: url('https://www.ancient-origins.net/sites/default/files/field/image/Agesilaus-II-cover.jpg');
background-position: center;
background-size: cover;
}
.wrap{
width: 360px;
margin: 50px 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>로그인하기</button>
</div>
</body>
</html>
