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

home2 게시판 HTML/CSS 게시판 "explain-box"가 버튼과 겹칩니다.

"explain-box"가 버튼과 겹칩니다.

  • 이 주제에는 2개 답변, 2명 참여가 있으며 강연기4 년 전에 전에 마지막으로 업데이트했습니다.
3 글 보임 - 1 에서 3 까지 (총 3 중에서)
  • 글쓴이
  • #10422

    강연기
    참가자

    선생님 안녕하세요. 수업 열심히 듣고 있습니다.

    대문 밑에 설명문을 겹치도록 배치 하는 수업 중에

     

    html 내용

    <!DOCTYPE html>

    <html>

     

    <head>

    <meta charset="UTF-8">

    <title>연습</title>

    <link rel="stylesheet" href="css/main.css">

    </head>

     

    <body>

    <div class="main-background">

    <div class="main-title-box">

    <h3 class="main-title">Buy our shooes!</h3>

    <p class="main-content">가나다라마바사가나다라마바사가나다라마바사가나다라마바사가나다라마바사가나다라마바사가나다라마바사가나다라마바사가나다라마바사가나다라마바사가나다라마바사</p>

    </div>

    <div>

    <button class="main-button position">버튼1</button>

    </div>

    <div class="explain-box">

    <h4>How we design</h4>

    <p>hahahahaha</p>

    </div>

    </div>

    </body>

     

    </html>

     

    css 내용

    .main-background {

    width: 100%;

    height: 500px;

    background-image: url(../img/shoes.jpg);

    background-size: cover;

    background-repeat: no-repeat;

    background-position: center;

    padding: 20px;

    position: relative;

    text-align: center;

    }

     

    body {

    margin: 0px;

    }

     

    .main-title {

    color: white;

    text-align: center;

    font-size: 30px;

    }

     

    .main-title-box {

    margin-top: 150px;

    text-align: center;

    }

     

    .main-content {

    padding: 30px;

    color: white;

    font-size: 18px;

    }

     

    .main-button {

    padding: 10px;

    font-size: 18px;

    font-family: 'nanumsqure';

    background-color: white;

    border: none;

    display: block;

    margin: auto;

    }

     

    .position {

    position: absolute;

    bottom: 90px;

    left: 0;

    right: 0;

    margin: auto;

    width: 150px;

    }

     

    .explain-box {

    width: 700px;

    margin: auto;

    padding: 20px;

    text-align: center;

    background-color: grey;

    position: relative;

    top: : 500px;

     

    }

     

     

    이와 같이 작성 하면 <div class="explain-box">가 <button class="main-button position">버튼1</button>아래에 위치 하지 않고, 겹쳐 있는 상태가 됩니다. 어디가 잘못된 것인가 해서 질문 드립니다. 감사합니다.

    #10425

    codingapple
    키 마스터

    top : : 500px 이거 콜론기호가 두개들어가서 오타나서 top 속성이 잘 반영이 안된듯요 

     

    #10427

    강연기
    참가자

    아, 네 선생님 이제 잘 되네요, 감사합니다. 

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 호 / 개인정보관리자 : 박종흠