Menu Vertical Sidebar

Postado: 29 de outubro de 2021

Menu Vertical Sidebar

Neste tutorial vamos fazer um menu vertical com html e css para usar no sidebar.

Vamos Adicionar o Html:

<nav class="menu-sidebar">

  <ul>
  
   <li class="nav-item">
      
      <div class="link-bg verde"></div>
      <div class="link-title">
        
        <div class="icone"> <i class="icofont-soft-drinks"></i></div>
        <a href="#" class="clique"><span>Bebidas</span></a>
      
      </div>

   </li>

   <li class="nav-item">
      
      <div class="link-bg vermelho"></div>
      <div class="link-title">
        
        <div class="icone"> <i class="icofont-apple"></i></div>
        <a href="#" class="clique"><span>Frutas</span></a>
      
      </div>
      
   </li>

   <li class="nav-item">
      
      <div class="link-bg marrom"></div>
      <div class="link-title">
        
        <div class="icone"> <i class="icofont-chicken-fry"></i></div>
        <a href="#" class="clique"><span>Salgados</span></a>
      
      </div>
      
   </li>

   <li class="nav-item">
      
      <div class="link-bg laranja"></div>
      <div class="link-title">
        
        <div class="icone"> <i class="icofont-hot-dog"></i></div>
        <a href="#" class="clique"><span>Lanches</span></a>
      
      </div>
      
   </li>
  
  </ul>

</nav>

Vamos Adicionar o css:

.menu-sidebar {

    margin: auto;
    float: none;
    width: 100%;
}

ul{
	
	margin:0px;
    padding:0px;
    list-style-type:none;
    -webkit-backface-visibility: hidden; 
    backface-visibility: hidden;  
}

.nav-item {

	position: relative;
	background:#fff; 
	box-shadow: 1px 0px 1.2px 0px #e3e3e3;
	width: 100%;
	height: 50px;
	margin-bottom: 2px;
	border-radius: 6px;
	overflow: hidden;

}

.link-bg {

	width:50px;
	height:50px;
	position:absolute;
	color:#fff;
	z-index:2;
	-webkit-transition: all 0.6s ease-in-out;
	-moz-transition: all 0.6s ease-in-out;
	-o-transition: all 0.6s ease-in-out;
	-ms-transition: all 0.6s ease-in-out;
	transition: all 0.6s ease-in-out; 

}

.link-bg.verde    { background-color:#c1ea50; }
.link-bg.vermelho { background-color:#ec3333; }
.link-bg.marrom   { background-color:#c87874; }
.link-bg.laranja  { background-color:#ff8e3c; }

.link-title:hover a { color:#ffffff; }

.link-bg i{

 position:relative;

}

.link-title{

	position:absolute;
    width:100%;
    z-index:3;
    color:#fff;
}

.link-title:hover .icone {

	-webkit-transform:rotate(25deg);
	-moz-transform:rotate(25deg);
	-o-transform:rotate(25deg);
	-ms-transform:rotate(25deg);
	transform:rotate(25deg);  

}

.nav-item:hover .link-bg{

	width:100%;
	-webkit-transition: all 0.6s ease-in-out;
	-moz-transition: all 0.6s ease-in-out;
	-o-transition: all 0.6s ease-in-out;
	-ms-transition: all 0.6s ease-in-out;
	transition: all 0.6s ease-in-out;  

}

.nav-item:hover a {

	-webkit-transition:all .5s ease-in-out;
	-moz-transition:all .5s ease-in-out; 
	-o-transition:all .5s ease-in-out; 
	-ms-transition:all .5s ease-in-out;
	 transition:all .5s ease-in-out;  

}

.icone {

	position:relative;
	width:50px;
	height:50px;
	text-align:center;
	color:#fff;
	-webkit-transition:all .5s ease-in-out;
	-moz-transition:all .5s ease-in-out; 
	-o-transition:all .5s ease-in-out; 
	-ms-transition:all .5s ease-in-out;   
	float:left;
	transition:all .5s ease-in-out;   
	float:left;  

}

.icone i{ 

	top: 10px;
	font-size: 1.8em;
	position: relative;
	display: inline;

}


.clique{
  
  width:100%;
  height:50px;
  font-family:"open_sansregular";
  color:#242424;
  display:block;
  position:absolute;
  float:left;
  text-decoration:none;
  text-align:center;
  -webkit-transition: all 0.6s ease-in-out;
  -moz-transition: all 0.6s ease-in-out;
  -o-transition: all 0.6s ease-in-out;
  -ms-transition: all 0.6s ease-in-out;
  transition: all 0.6s ease-in-out;

}

span{

    display:block;
    margin-top:15px;

}

/*Responsivo*/
/*768PX BREAKPOINT*/
@media (min-width:48em){

    .menu-sidebar { width:30%; }

}

Veja o Resultado!

Baixar Código Veja Funcionando

Publicado por: loopnerd

671 Visualizações

Deixe um comentário

O seu endereço de e-mail não será publicado.