커뮤니티
포인트
로딩중
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
박스 크기 변경
undefined주차
북마크
김*양
댓글
5
추천
0
조회수
7
조회수
7
답변 완료

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

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


안녕하세요.


수업 중에 궁금한 점이 생겼습니다! (설명하기가 너무 어려워요.. )

코드1 (body):

<body>
<div class="form-floating">
  <textarea class="form-control" placeholder="Leave a comment here" id="floatingTextarea"></textarea>
  <label for="floatingTextarea">Comments</label>
</div>
<body>
스파르타 즉문즉답

을 밑의 사진처럼 변경하고 싶어서(코멘트 상자가 좀 더 넓게 표현) <head> - <style> 에서 height 값을 줘도 변경이 안 됩니다.

스파르타 즉문즉답



사진 2의 '코멘트' 코드를 확인 해보니

코드2 (body):

<body>
<div class="form-floating">
  <textarea class="form-control" placeholder="Leave a comment here" id="floatingTextarea2" style="height: 100px"></textarea>
  <label for="floatingTextarea2">Comments</label>
</div>
</body>


이렇더라구요.


Q. style이 저 속에 있어야만 '코멘트 박스' 크기의 변경이 가능한가요? (제가 지금 style을 head내에서 변경하는 것만 배웠습니다.)




/*제가 했던 방법*/


<!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>

    <style>

        @import url('https://fonts.googleapis.com/css2?family=Gowun+Dodum&display=swap');


        * {

            font-family: 'Gowun Dodum', sans-serif;

        }


        .mytitle {

            background-color: green;

            color: white;


            height: 250px;


            display: flex;

            flex-direction: column;

            align-items: center;

            justify-content: center;


            background-image: linear-gradient(0deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('https://movie-phinf.pstatic.net/20210715_95/1626338192428gTnJl_JPEG/movie_image.jpg');

            background-position: center;

            background-size: cover;

        }


        .mytitle>button {

            width: 250px;

            height: 50px;


            background-color: transparent;


            border: 1px solid white;

            color: white;


            border-radius: 50px;


            margin-top: 20px;

        }


        .mytitle>button:hover {

            border: 2px solid white;

        }


        .mycomment {

            color: grey;

        }


        .mycards {

            width: 1200px;

            margin: 20px auto 20px auto;

        }


        .mypost{

            width: 500px;

            margin: 20px auto 20px auto;

            padding: 20px 20px 20px 20px;

            box-shadow: 0px 0px 3px 0px gray;

        }


        .mybtn{

            display: flex;

            flex-direction: row;

            align-items: center;

            justify-content: center;


            margin-top: 20px;

        }


        .mybtn > button {

            margin-right: 10px;

        }


        .form-floating {                        /*이부분을 이렇게도 해보고*/

            height: 150px;

        }

       

        .form-control1 {                        /*이부분 이렇게 해도 안 되네요.. ㅎㅎ */

            height: 150px;

        }

                 


    </style>

</head>


<body>

    <div class="mytitle">

        <h1>내 생애 최고의 영화들!!</h1>

        <button>영화 기록하기</button>

    </div>

    <div class="mypost">

        <div class="form-floating mb-3">

            <input type="email" class="form-control" id="floatingInput" placeholder="name@example.com">

            <label for="floatingInput">영화 URL</label>

        </div>

    <div class="mypoint">

        <div class="input-group mb-3">

            <label class="input-group-text" for="inputGroupSelect01">⭐별점⭐</label>

            <select class="form-select" id="inputGroupSelect01">

              <option selected>--선택하기--</option>

              <option value="1"></option>

              <option value="2">⭐⭐</option>

            </select>

          </div>

         

    </div>

        <div class="form-floating">

            <textarea class="form-control1" placeholder="Leave a comment here" id="floatingTextarea" ></textarea>

            <label for="floatingTextarea">코멘트</label>

        </div>

        <div class="mybtn">

            <button type="button" class="btn btn-dark">기록하기</button>

            <button type="button" class="btn btn-outline-dark">닫기</button>

        </div>

    </div>

    <div class="mycards">

        <div class="row row-cols-1 row-cols-md-4 g-4">

            <div class="col">

                <div class="card h-100">

                    <img src="https://movie-phinf.pstatic.net/20210728_221/1627440327667GyoYj_JPEG/movie_image.jpg"

                        class="card-img-top" alt="...">

                    <div class="card-body">

                        <h5 class="card-title">영화 제목이 들어갑니다</h5>

                        <p class="card-text">여기에 코멘트가 들어갑니다</p>

                        <p>⭐⭐⭐</p>

                        <p class="mycomment">여기에 나의 의견을 써주세요</p>

                    </div>

                </div>

            </div>

        </div>

    </div>

</body>


</html>



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