Center navigation bars logo and links - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Nav bar image

Description

Center navigation bars logo and links

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">
.nav {<!--from   ww w . jav a2 s.  c o m-->
   margin-top:201px;
   height:121px;
   background-color:Chartreuse;
}

.nav ul {
   height:100%;
   display:flex;
   align-items:center;
}

.nav ul li {
   list-style:none;
   width:21%;
   text-align:center;
}

.nav ul li a {
   font-weight:bold;
   font-size:22px;
   color:yellow;
   text-decoration:none;
}

.logo {
   background:url('https://www.java2s.com/style/demo/Google-Chrome.png');
   background-repeat:no-repeat;
   height:141px;
}

.nav ul li a:hover, .nav ul li.active a {
   color:blue;
}
</style> 
 </head> 
 <body> 
  <div class="nav"> 
   <ul> 
    <li> <a href="#">Lore</a> </li> 
    <li> <a href="#">Lor</a> </li> 
    <li> <a class="logo" href="#"></a> </li> 
    <li class="active"> <a href="#">Lorem ip</a> </li> 
    <li> <a href="#">Lorem i</a> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials