커뮤니티
포인트
로딩중
쿠폰
내 강의실
국비 신청 내역
수강권
증명서
숙제 피드백
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
사진 위치 고정
웹개발 종합반
1주차
북마크
김*영
댓글
4
추천
0
조회수
12
조회수
12
답변 완료

창 크기가 바뀌면 사진 위치가 같이 바뀌는데, 고정할 수 있는 방법 알려주세요~!

스파르타 즉문즉답스파르타 즉문즉답
<!doctype html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
    integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
    integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
    crossorigin="anonymous"></script>

    <title>숨비 팬명록</title>
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@200;300;400;500;600;700;900&display=swap" rel="stylesheet">
    <style>
        * {
            font-family: 'Noto Serif KR', serif;
        }

        .mytitle {
            width: 100%;
            height: 250px;

            background-image: linear-gradient(0deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("https://images.khan.co.kr/article/2022/02/05/2022020502000190400036051.jpg");
            background-repeat: no-repeat;
            background-size: cover;
            background-position: center -300px;
            /*이미지 위치를 고정해야 함*/

            color: white;

            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }
        .mypost {
            box-shadow: 0px 0px 3px 0px gray;
            max-width: 500px;
            width: 95%;
            margin: 20px auto 0px auto;
            padding: 20px;
        }
        .form-floating {
            margin-bottom: 20px;
        }
        .card {
            max-width: 500px;
            width: 95%;
            margin: 20px auto 20px auto;
        }
    </style>
</head>

<body>
    <div class="mytitle">
        <h1>숨비</h1>
    </div>
    <div class="mypost">
        <div class="mb-3">
          <input type="text" class="form-control" id="formGroupExampleInput" placeholder="닉네임">
        </div>
        <div class="form-floating">
                <textarea class="form-control" placeholder="Leave a comment here" id="floatingTextarea2"
                          style="height: 100px"></textarea>
            <label for="floatingTextarea2">응원댓글</label>
        </div>
        <button type="button" class="btn btn-dark">응원 남기기</button>
    </div>
    <div class="card">
      <div class="card-body">
        <blockquote class="blockquote mb-0">
          <p>부동</p>
          <footer class="blockquote-footer">숨비</footer>
        </blockquote>
      </div>
    </div>
    <div class="card">
      <div class="card-body">
        <blockquote class="blockquote mb-0">
          <p>사랑은 영원하다</p>
          <footer class="blockquote-footer">숨비</footer>
        </blockquote>
      </div>
    </div>
    <div class="card">
      <div class="card-body">
        <blockquote class="blockquote mb-0">
          <p>열여덟의 겨울</p>
          <footer class="blockquote-footer">숨비</footer>
        </blockquote>
      </div>
    </div>
</body>

</html>
취소
 공유
취소
댓글 0
댓글 알림
나의얼굴