Hover flat Menu


Con un poco de CSS aprenderemos a crear un meno plano el cual nos servira para darle un toque hermoso a nuestras plantillas

HTML
<div id="menu">
  <a href="#" class="profile">Profile <span class="entypo-user"></span></a>

 <!-- The hidden menu -->  
 <ul>
    <li><a href="#">Account settings <span class="entypo-cog"></span></a></li>
    <li><a href="#">Statistics <span class="entypo-chart-area"></span></a></li>
    <li><a href="#">Link <span class="entypo-link"></span></a></li>
    <li><a href="#">Record <span class="entypo-mic"></span></a></li>
    <li><a href="#">Database <span class="entypo-database"></span></a></li>
    <li><a href="#">Sign Out <span class="entypo-block"></span></a></li>
  </ul>
</div>

CSS
/*=== Style ===*/
/*=== Import icon fonts (http://weloveiconfonts.com) ===*/
@import url(http://weloveiconfonts.com/api/?family=entypo);
/* entypo */
[class*="entypo-"]:before { font-family: 'entypo', sans-serif }
/*=== Reset & General style ===*/
* {
    -webkit-font-smoothing: antialiased;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    -ms-box-sizing: border-box;
    box-sizing: border-box;
    font-family: helvetica neue;
    font-weight: 500;
    text-transform: uppercase;
}
body,
html {
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    background: #a7d5cd;
}
/*=== Let's style the elements ===*/
a {
    color: #e9e9e8;
    text-decoration: none;
}
#menu {
    width: 400px;
    margin: 60px auto;
    height: 40px;
}
#menu .profile {
    background: #4f4f4b;
    width: 90%;
    height: 55px;
    padding: 10px 15px;
    display: block;
    /*box-shadow*/
    -webkit-box-shadow: 0 15px 16px -6px rgba(0,0,0,.2);
    -moz-box-shadow: 0 15px 16px -6px rgba(0,0,0,.2);
    box-shadow: 0 15px 16px -6px rgba(0,0,0,.2);
    position: relative;
    line-height: 2.2;
    z-index: 3;
}
#menu .profile span { line-height: 1.9 }
#menu a span {
    float: right;
    text-shadow: 0 0 2px rgba(0,0,0,.4);
    font-size: 1.2em;
    line-height: 2.7;
}
ul {
    list-style: none;
    padding: 0;
    margin: -200px 0;
    opacity: 0;
    /*transition*/
    -webkit-transition: all .1s linear .5s;
    -moz-transition: all .1s linear .5s;
    -o-transition: all .1s linear .5s;
    transition: all .1s linear .5s;
}
ul:before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 14px solid #df826b;
    position: absolute;
    margin: -14px 330px;
}
ul li {
    background: #4f4f4b;
    width: 90%;
    height: 40px;
    padding: ;
    display: block;
    /*box-shadow*/
    -webkit-box-shadow: 0 15px 16px -6px rgba(0,0,0,.2);
    -moz-box-shadow: 0 15px 16px -6px rgba(0,0,0,.2);
    box-shadow: 0 15px 16px -6px rgba(0,0,0,.2);
}
ul li a {
    width: 100%;
    height: 55px;
    padding: 0px 15px;
    margin: 15px auto 10px;
    display: block;
    background: #df826b;
    border-bottom: 5px solid #4f4f4b;
    line-height: 3.1;
}
ul li a:hover { background: #4f4f4b }
ul li:last-child a {
    border: 0;
    height: 50px;
}
/*== Display the menu when the user hover the link ==*/
#menu:hover  ul {
    opacity: 1;
    margin: 30px auto;
    /*transition*/
    -webkit-transition: all .1s linear;
    -moz-transition: all .1s linear;
    -o-transition: all .1s linear;
    transition: all .1s linear;
}

Entradas que pueden interesarte