css 드롭다운메뉴가 안내려와요 ㅜㅜ

css 드롭다운메뉴가 안내려와요 ㅜㅜ

QA

css 드롭다운메뉴가 안내려와요 ㅜㅜ

본문

<html>

 

<body>

    <header>

        <div class="wrapper">

            <div class="header--tertiary">

                <!-- 로그인,이용권,이벤트 -->

                <ul>

                    <li class="log-in">

                        로그인

                    </li>

                    <li class="use">

                        이용권

                    </li>

                    <li class="event">

                        이벤트

                    </li>

                </ul>

            </div>

        </div>

        <div class="header--second">   

            <!-- 검색창 -->

            <div class="search-box">

                <input class="search-txt" placeholder="검색하기">

                <!-- 검색 아이콘 -->

                <span class="material-icons">

                    search

                </span>

            </div>

            <div class="main">

                <!-- 로고 이미지 -->

                <!-- 클릭하면 홈으로 이동하는 링크가 걸려있습니다 -->

                <a href="#" class="logo">

                    <img src="./wavve.png" alt="로고">

                </a>

                <div class="menu">

                    <div class="header--secondary">

                        <ul class="main">

                            <li class="item">

                                <div class="item__title">

                                    <div class="item_name">홈</div>

                                </div>

                            </li>

                            <li class="main">

                                <div class="item__title">

                                    <div class="item___name">카테고리</div>                                    

                                    <div class="item__contents">

                                        <ul>

                                            <li>전체 카테고리 보기</li>

                                            <li>추천메뉴</li>

                                            <li>드라마</li>

                                            <li>예능</li>

                                            <li>영화</li>

                                            <li>영화플러스</li>    

                                            <li>해외시리즈</li>

                                            <li>ORIGINAL</li>

                                            <li>프로야구</li>

                                        </ul>

                                    </div>

                                </div>       

                            </li>

                            <li class="item">

                                <div class="itme__title">

                                    <div class="item__name">LIVE</div>

                                </div>

                            </li>

                            <li class="item">

                                <div class="item__title">

                                    <div class="item__name">MY</div>

                                </div>

                            </li>

                        </ul>

                    </div>

                </div>        

            </div>

        </div>     

    </header>    

</body>

</html>

 

<css>

 

body {

    font-family: 'Noto Sans KR', sans-serif;

    font-size: 16px;

    font-weight: 400;

    line-height: 1.4;

    background:#1b1b1b;    

    height: 3000px;

}

 

.wrapper {

    width: 1100px;

    margin: 0 auto;

    position: relative;

}

 

img {

    display: block;

    padding-left: 144px;

}

 

a {

    text-decoration: non;

}

 

/* HEADER */

 

header>.wrapper {

    background: #1b1b1b;

    height: 34px;

    width: 100%;

    justify-content: space-between;

    display: flex;

    flex-direction: column;

    position: fixed;

}

 

header>.wrapper {

    display: flex;

    flex-direction: column;

}

 

header .header--tertiary>ul {

    color: #a5a5a5;

}

 

header .header--tertiary {

    position: absolute;

    top: 0;

    width: 100%;

    height: 34px;

    border-bottom: 1px solid #2c2c2e;

    box-sizing:border-box;

    font-size: 12px;

    display: flex;

}

 

header .header--tertiary>ul {

    position:absolute;

    top: 0;

    bottom: 2px;

    right: 123px;

    margin: auto 0;

    display: flex;

    align-items: center;

}

 

header .header--tertiary>ul li {

    float: left;

    margin-left: 12px;

    margin-right: 12px;

}

 

header .header--tertiary>ul li.log-in {

    display: flex;

    align-items: flex-end;

    cursor: pointer;

}

 

header .header--tertiary>ul li.use {

    display: flex;

    align-items: flex-end;

    cursor: pointer;

}

 

header .header--tertiary>ul li.event {

    display: flex;

    align-items: flex-end;

    cursor: pointer;    

}

 

header .main {

    position: relative;

}

 

header .logo {

    display: block;

    position:inherit;

    top: 0;

    bottom: 0;

    left: 0;

    margin: auto ;

    position: absolute;

}

 

header .logo img {

    width: 111px;

    height: 20px;

    top: 141px;

    bottom: 0;

    margin: auto 0;

    position: absolute;

}

 

header .header--second {

    background:#1b1b1b;

    height: 108px;

    width: 100%;

    justify-content: space-between;

    display: flex;

    flex-direction: column;

}

 

header .menu {

    position: absolute;

    top: 57.5px;

    left: 20.9%;

    padding-right:40px;

    width: calc(100% - 100px);

    display: flex;

    flex-direction: column;

    box-sizing: border-box;

}

 

header .menu .header--secondary ul.main .item__name {

    display: block;

    padding: 20px;

    font-size: 20px;

}

 

header .menu .header--secondary ul.main .item_name {

    display: block;

    padding: 20px;

    font-size: 20px;

    color: white;

}

 

header .menu .header--secondary ul.main .item_name:hover {

    cursor: pointer;

}

 

header .menu .header--secondary ul.main .item___name {

    display: block;

    padding: 20px;

    font-size: 20px;

    

}

 

header .menu .header--secondary ul.main .item___name:hover {

    cursor: pointer;

    color: white;

}

 

header .search-box {

    position: absolute;

    display: inline-block;

    flex-direction: column;

    box-sizing: border-box;

    height: 40px;

    border-radius: 40px;

    top: 5.4%;

    right: -2%;

    padding: 20px;

}

 

.material-icons {

    color: #A5A5A5;

    float: left;

    width: 40px;

    height: 25px;

    font-size: 28px;

    display: flex;

    justify-content: center;

    align-items: center;

    cursor: pointer;

}

 

.search-txt {

    border: none;

    background: #1b1b1b;

    outline: none;

    padding: 0;

    font-size: 17.5px;

    /* transition: .4s; */

    line-height: 27px;

    font-weight:normal;

}

 

header .menu .header--secondary {

    position: relative;

    color: #a5a5a5;

    height: 25px;

    display: flex;

    font-size: 13px;

    align-items: center;

}

 

header .menu .header--secondary ul.main {

    float: left;

    transition: .4s;

    height: 25px;

    padding: 0 5px;

    display: flex;

    align-items: center;

}

 

header .menu .header--secondary ul.main li.menu .item__title .item__name {

    top: 50px;

}

 

header .menu .header--secondary ul.main .item__name:hover {

    color: #F6F5F0;

    transition: .4s;

    cursor: pointer;

}

<이부분에 드롭다운메뉴했는데 안내려와요ㅜㅜ>

header .menu .header--secondary ul.main .item__contents {

    display: none;

}

 

header .menu .header--secondary ul.main li.item___name:hover .item__contents {

    display: block;

}

 

이 질문에 댓글 쓰기 :

답변 1

두 요소가 대등하게 있는데, CSS는 자손처럼 정의해서 그렇네요.

현재 구조가 아래와 같습니다.

<li class="main">
<div class="item__title">
<div class="item___name">카테고리</div>
<div class="item__contents">

님이 짠 게 작동하라면,
<div class="item__contents"> 내용이 카테고리 글자 바로 뒤로 가야 합니다.

답변을 작성하시기 전에 로그인 해주세요.
전체 1,124
QA 내용 검색
filter #html ×

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT