vertically align icons on the navigation bar - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Nav Bar

Description

vertically align icons on the navigation bar

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
#element-container {<!--  ww  w  .  ja  v a 2s  . c o m-->
   width:100%;
   height:151px;
   background-color:Chartreuse;
   text-align:center;
}

.element {
   width:51px;
   height:51px;
   background-color:yellow;
   display:inline-block;
   margin-right:21px;
   position:relative;
   top:calc(51% - 26px);
}
</style> 
 </head> 
 <body> 
  <div id="element-container"> 
   <div class="element"></div> 
   <div class="element"></div> 
   <div class="element"></div> 
   <div class="element"></div> 
   <div class="element"></div> 
  </div>  
 </body>
</html>

Related Tutorials