커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
같은 300px 로 했는데 왜 차이가 날까요?
undefined주차
북마크
이*윤
댓글
3
추천
0
조회수
7
조회수
7
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.


안녕하세요~

진행이 안될 정도는 아니고 마이너한 문제기는 하지만 궁금해서 여쭤봅니다!

코드를 아래와 같이 mytitle도 300px 로 하고, wrap 도 300px 로 width 를 지정했는데 아래 보는 것과 같이 초록색 영역(wrap)과 차이가 나서요!

왜 둘이 맞춰지지 않는걸까요?

강의에서는 둘이 똑같아보였습니다.



스파르타 즉문즉답




<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>로그인 페이지</title>
    <style>
        .mytitle {
            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: 40px;
        }
        .wrap {
            background-color: green;
            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>




취소
 공유
취소
댓글 0
댓글 알림
나의얼굴