Skip to main content

Pure CSS Hamburger Menu | Side Bar Menu

Video: 


Source Code:




HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="style.css">
    <title>Hamburger Menu</title>
</head>
<body>
    <input type="checkbox" name="" id="check">
    <label class="ham_menu" for="check">&#9776;</label>
    <div class="main">
        <label for="check">&times;</label>
        <h1>Menu</h1>
        <ul>
            <li><a href="#">Home</a></li>
            <li><a href="#">Service</a></li>
            <li><a href="#">About</a></li>
            <li><a href="#">Contact</a></li>
            <li><a href="#">Sign Up</a></li>
        </ul>
    </div>
</body>
</html>

CSS

*{
    margin0;
    padding0;
    font-familyCentury Gothic;
    box-sizingborder-box;
}
body{
    backgroundurl("bg.jpg")no-repeat;
    background-sizecover;
}

#check{
    displaynone;
}

#check:checked ~ .main{
    positionabsolute;
    left.1%;
    top.1%;
}

.ham_menu{
    font-size30px;
    color#ffffff;
    margin-left20px;
    line-height50px;
    cursorpointer;
}

.main{
    width15%;
    background#2c3e50;
    text-aligncenter;
    padding50px 20px;
    border-radius8px;
    positionabsolute;
    left-15%;
    top.1%;
    transition.3s;
}
.main h1{
    color#ffffff;
    padding-bottom50px;
}
.main ul{
    list-stylenone;
}
.main ul li {
    padding-bottom15px;
}
.main ul li a{
    text-decorationnone;
    color#ffffff;
}
.main label{
    color#ffffff;
    font-size30px;
    positionabsolute;
    top2%;
    left80%;
    cursorpointer;
}



Comments

Post a Comment

Popular posts from this blog

Amazing 404 Error Page Using HTML & CSS

  Video: Source Code: <! DOCTYPE   html > < html   lang = "en" > < head >     < meta   charset = "UTF-8" >     < meta   name = "viewport"   content = "width=device-width, initial-scale=1.0" >     < meta   http-equiv = "X-UA-Compatible"   content = "ie=edge" >     < title >Error! 404</ title > </ head > <style> * {     margin:  0 ;     padding:  0 ;     font-family: Nunito;     box-sizing:  border-box ; } body {     background:  linear-gradient (to  right ,  #48dbfb ,  #1dd1a1 );     display:  flex ;     align-items:  center ;     justify-content:  center ;     min-heigh...

UI Card Design Using Only HTML and CSS

\ <! DOCTYPE   html > < html   lang = "en" > < head >     < meta   charset = "UTF-8" >     < meta   name = "viewport"   content = "width=device-width, initial-scale=1.0" >     < meta   http-equiv = "X-UA-Compatible"   content = "ie=edge" >     < title >UI CARD DESIGN</ title >     < link   rel = "stylesheet"   href = "style.css" > </ head > < body >     < div   class = "box" >         < div   class = "text" >             < h2 >Gaming Mouse</ h2 >             < p >Lorem ipsum dolor sit amet consectetur adipisicing...