<! -- html 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>Accordion-Menu</title>
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/"
        crossorigin="anonymous">
        <link rel="shortcut icon" href="https://res.cloudinary.com/djnxdb9dr/image/upload/v1541690900/pb.png" type="image/x-icon">
        <link rel="stylesheet" href="accordion.css">

    </head>
<body>
  <div class="container">
    <div class="accordion">
    <div class="menu">
    <li class="item" id="profile">
        <a href="#profile" class="btn"><i class="fas fa-user"></i>Profile</a>
        <div class="smenu">
        <ul>
            <a href="https://prabhakar9107.github.io/" ><i class="fas fa-blog"></i>Posts</a>
        </ul>
        <ul>
            <a href="#" ><i class="far fa-images"></i>Pictures</a>
        </ul>
        </div>
    </li>
    <li class="item" id="message">
        <a href="#message" class="btn"><i class="fas fa-envelope"></i>Messages</a>
        <div class="smenu">
            <ul>
                <a href="https://www.facebook.com/prabhakar.bansal"> <i class="fab fa-facebook-f"></i>Facebook</a>
            </ul>
            <ul>
                <a href="https://web.telegram.org/#/im" ><i class="fab fa-telegram-plane"></i>Telegram</a>
            </ul>
        </div>
    </li>
    <li class="item" id="follow">
      <a href="#follow" class="btn"><i class="fas fa-address-book"></i>Follow Me</a>
        <div class="smenu">
            <ul>
                <a href="https://twitter.com/02panjiyara" ><i class="fab fa-twitter"></i>Twitter</a>
            </ul>
            <ul>
                <a href="https://www.instagram.com/prabhakar_bansal/"><i class="fab fa-instagram"></i>Instagram</a>
            </ul>
            <ul>
                <a href="https://github.com/PRABHAKAR9107" ><i class="fab fa-github"></i>Github</a>
            </ul>
        </div>
    </li>
    <li class="item" id="settings">
        <a href="#settings" class="btn" ><i class="fas fa-cogs"></i>Settings</a>
        <div class="smenu">
            <ul>
                <a href="#"><i class="fas fa-key"></i>Password</a>
                <a href="#" ><i class="fas fa-globe"></i>Languages</a>
            </ul>
        </div>
    </li>
    <li class="item" >
        <a href="" class="btn"><i class="fas fa-sign-out-alt"></i>Logout</a>
    </li>
    </div>
    </div>
    </div>
</body>
</html>

*{
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    list-style: none;
    text-decoration: none;
   

}

body{
     background: radial-gradient(#77A1D3,#79CBCA,#E684AE);
     height: 100vh;
     width:100vw;
     background-size: 200% 200%;
	background-position: -100% 50%;
}



.accordion{
    position: absolute;
    top:50%;
    left:50%;
    transform: translate(-50%,-50%);
}

.menu{
    width:  300px;
    border-radius: 8px;
    overflow: hidden;

}
.item{
    border-top: 1px solid;
    overflow: hidden;
}
.btn{
    display: block;
    padding: 16px 20px;
    background: #1e90ff;
    color: white;
}
.btn:before{
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    background: #1e90ff;
    left:20px;
    bottom: -7px;
    transform: rotate(45deg);

}

.btn i{
    margin-right: 10px;

}
.smenu{
    background: #333;
    overflow: hidden;
    transition: max-height 0.3s;
    max-height: 0;
}
.smenu a{
    display: block;
    padding: 16px 20px;
    color: white;
    font-size: 14px;
    margin: 4px 0;
    position: relative;

}

.smenu a:before{
    content: "";
    position: absolute;
    width: 6px;
    height: 100%;
    left: 0;
    top: 0;
    transition: 0.3s;
    opacity: 0;

}
.smenu a:hover:after{
    opacity:0;
}
.item:target .smenu{
    max-height: 10em;
}

/* --- js code ----  */

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.