HTML center on middle img and menu - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu

Description

HTML center on middle img and menu

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">
body {<!--from  www. ja v  a2  s  .c  o m-->
   margin:0;
}

header {
   background-color:Chartreuse;
   width:100%;
   height:201px;
   text-align:center;
}

#logo {
   width:251px;
   height:173px;
}

#menutop1 {
   list-style-type:none;
   overflow:hidden;
   text-align:center;
}

#menutop1 li {
   display:inline-block;
}

#menutop1 li a {
   display:block;
   color:yellow;
   text-align:center;
   padding:15px 17px;
   text-decoration:none;
}

#menutop1 li a:hover:not(.active) {
   background-color:blue;
}
</style> 
 </head> 
 <body> 
  <header> 
   <img id="logo" src="https://www.java2s.com/style/demo/Opera.png"> 
   <ul id="menutop1"> 
    <li> <a href="#home">Lore</a> </li> 
    <li> <a href="#news">Lore</a> </li> 
    <li> <a href="#contact">Lorem i</a> </li> 
    <li> <a href="#about">Lorem</a> </li> 
   </ul> 
  </header>  
 </body>
</html>

Related Tutorials