Horizontally align a picture with a navigation bar - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Align

Description

Horizontally align a picture with a 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">

#firstpic {<!-- ww  w . j  ava 2s .  c o  m-->
   margin: 0px;
   padding: 0px;
   display: inline-block;
}
#propic {
}
#navigation {
   border-bottom: 2px dotted #000000;
}
.bh {
   border-right: 2px solid black;
}
.navbar {
   font-size: 50px;
   text-align: center;
   font-family: Courier;
   display: inline;
   vertical-align:top;
}
.navbar li {
   display: inline-block;
}


      </style> 
 </head> 
 <body> 
  <div id="navigation"> 
   <div id="firstpic"> 
    <img src="https://www.java2s.com/style/demo/Google-Chrome.png" id="propic"> 
   </div> 
   <ul class="navbar"> 
    <li class="bh">Home</li> 
    <li class="bh">About Me</li> 
    <li>Contact</li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials