Center Logo in the navbar - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Nav bar image

Description

Center Logo in the navbar

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <style>
.parent-element {<!--from  w w  w .j  a  v a2s .  c  o m-->
   position:relative;
   width:201px;
   height:51px;
   outline:2px solid Chartreuse;
}

.child {
   position:absolute;
   outline:2px solid yellow;
   left:51%;
   top:51%;
   transform:translate(-51%, -51%);
}
</style> 
 </head> 
 <body translate="no"> 
  <div class="parent-element"> 
   <div class="child">
     Lorem ipsum d 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials