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

home2 게시판 HTML/CSS 게시판 div 크기

div 크기

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

    김상원
    참가자
    html은
    
    
    <div class = "entire-box">
        <div class = "box" style = "position : relative">
            <div class = "box2">
                <div class = "box3">
                    <p style = "color : whitesmoke">아 이 망할 box2 사진 크기랑 어떻게 똑같이 만드냐</p>
                </div>
            </div>
            
        </div>
        <div class = "box"></div>
        <div class = "box"></div>
    </div>
    이렇게 제작했고
    css는
    
    
    .entire-box {
        background-color: #eee;
        margin : auto;
        display : flex;
    }
    .box {
        width : 33%;
        padding : 30px;
    }
    .box img {
        width : 100%;
    }
    .box2 {
        width : 100%;
        height : 100%;
        position : absolute;
        overflow : hidden;
    }
    .box3 {
        width : 100%;
        height : 100%;
        background-color: grey;
        margin-top : 100%;
        opacity : 0;
        transition: margin-top 2s;
    }
    .box2:hover .box3 {
        margin-top : 50%;
        opacity: 0.5;
    }
    
    이렇게 만들었습니다.
    transition기능은 생각한대로 작동은 하는 것 같은데
    img랑 transition올라오는 div크기가 다릅니다.
    어디서 틀린건가요..??
    KakaoTalk_20231109_202813066
    
    #103568

    codingapple
    키 마스터
    <div class = "box" 안에 position relative 주는 div 하나 더 만들고
    거기 이미지랑 까만박스 넣어봅시다
2 글 보임 - 1 에서 2 까지 (총 2 중에서)
  • 답변은 로그인 후 가능합니다.

About

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

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

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