• 로그인
  • 장바구니에 상품이 없습니다.

home2 게시판 HTML/CSS 게시판 contact us 만들기 질문이요

contact us 만들기 질문이요

3 글 보임 - 1 에서 3 까지 (총 3 중에서)
  • 글쓴이
  • #17988

    강인웅
    참가자

    1. 모든 div를 감싸는 container class에 width 500px을 주고

    input width도 500px을 주면 border 때문에 튀어나오더라구요

    그래서 결국 width를 496px로 맞췄는데 원래 이런 식으로 해결해야 되는 건가요? 아니면 근본적인 해결방법이 있을까요

    1번 질문 이미지

     

    2. send를 감싸는 박스의 크기를 줄이고 싶어서 height 픽셀에 조정을 주면

    안에 들어있는 h2 'send' 는 div에 크기에 맞게 조정되는 것이 아니라 그대로입니다. 마진을 줄여줘서 가운데 수직정렬을 맞춰줬는데

    h2를 아예 div에 핏하게 맞출 수는 없는 건가요? 개발자 도구로 보면 h2가 div를 튀어나오는데 이것도 일일이 개발자도구를 봐가면서

    margin을 줄여주는 방법밖에는 없는 건가요? margin:auto를 h2에 줘도 그대로여서 방법이 있나 싶습니다!2번 질문 이미지

    #17989

    강인웅
    참가자

    ----------------------------------------------------------------html 소스 ------------------------------------------------------------------------------------

    <!DOCTYPE html>
    <head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="style2.css">
    <title>Document</title>
    </head>
    <body>
    <div class="container">
    <div>
    <h1>contact us</h1>
    </div>
    <div>
    <h3>Your Email</h3>
    <form class="email-box">
    <input type="email" value="email@example.com">
    </form>
    </div>
    <div class="firla-box">
    <div class="first-box">
    <h3>First Name</h3>
    <form>
    <input type="text">
    </form>
    </div>
    <div class="last-box">
    <h3>Last name</h3>
    <form>
    <input type="text">
    </form>
    </div>
    </div>
    <div class="message-box">
    <h3>Message</h3>
    <form>
    <input type="text">
    </form>
    </div>
    <div class="rs-box">
    <div class="radio-box">
    <form>
    <input type="radio">subscribe
    </form>
    </div>
    <div class="send-box">
    <h2>SEND</h2>
    </div>
    </div>
    </div>
    </body>
    </html>

     

    ------------------------------------------------------------------css 소스-------------------------------------------------------------------------------------

    div {
    box-sizing: border-box;
    }

    .container {
    width: 500px;
    height: 500px;
    margin: auto;
    }

    .first-box {
    float: left;
    }

    .firla-box input {
    width: 180px;
    }

    .last-box {
    float: left;
    position: absolute;
    right: 0;
    }

    .message-box {
    clear: both;
    }

    .message-box > form > input {
    height: 100px;
    width: 496px;
    padding: 0px;
    }

    .radio-box {
    float: left;
    margin-top: 25px;
    }

    .send-box {
    float: left;
    display: block;
    position: absolute;
    right: 0;
    background: yellow;
    width: 120px;
    text-align: center;
    top: 10px;
    height: 50px;
    }

    .send-box > h2 {
    margin-top: 12px;
    }

    .rs-box {
    position: relative;
    }

    .firla-box {
    position: relative;
    }

    .email-box > input {
    width: 496px;
    padding: 0px;
    }

    #17994

    codingapple
    키 마스터

    1은 박스에 box-sizing 옵션을 조절하거나 해봅시다 

    2는 마진 대신 상하 padding을 주면 될듯 합니다

3 글 보임 - 1 에서 3 까지 (총 3 중에서)
  • 답변은 로그인 후 가능합니다.

About

현재 월 700명 신규수강중입니다.

  (09:00~20:00) 빠른 상담은 카톡 플러스친구 코딩애플 (링크)
  admin@codingapple.com
  이용약관
ⓒ Codingapple, 강의 예제, 영상 복제 금지
top

© Codingapple, All rights reserved. 슈퍼로켓 에듀케이션 / 서울특별시 강동구 고덕로 19길 30 / 사업자등록번호 : 212-26-14752 온라인 교육학원업 / 통신판매업신고번호 : 제 2017-서울강동-0002 호 / 개인정보관리자 : 박종흠