본문 바로가기
Web/HTML | CSS|JAVASCRIPT

햄버거 메뉴 토글 기능 만들기(HTML, CSS)

by 싸공 2020. 7. 15.
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
body{
    background-colorwhite;
}
.container{
    positionabsolute;
    top30%;
    left50%;
    transformtranslate(-50%-50%);
}
.menu{
    width149px;
    height149px;
    background-color#ee81b7;
    box-shadow0 0 35px rgb(625359);
    cursorpointer;
    positionrelative;
    border-radius12px;
}

div{
    positionabsolute;
    height11px;
    background-colorwhite;
    transition: width 0.5s ease;
    border-radius4px;
}
.one{
    width70px;
    top40px;
    left20px;
}

.two{
    width40px;
    top70px;
    left20px;
}
.three{
    width50px;
    top100px;
    left20px;
}
.menu:hover div{
    width:60px;
    transition: width 0.5s ease;
}
</style>
<body>
    <div class="container">
        <div class="menu">
            <div class="one"></div>
            <div class="two"></div>
            <div class="three"></div>
        </div>
    </div>  
</body>
</html>