Positioning the text in the center of li tag - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Element

Description

Positioning the text in the center of li tag

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">
.container ul {<!--from   w w  w  .  j  a v a2s.  c o  m-->
   list-style:none outside none;
}

li {
   display:list-item;
}

.col-md-4 {
   width:34%;
}

.nav-block {
   background-color:Chartreuse;
   display:block;
   min-height:71px;
   position:relative;
   text-align:center;
   line-height:61px;
}

.container .nav-block .header {
   color:yellow;
   font-size:3em;
   font-weight:bold;
   left:0;
   padding:6px;
   position:relative;
   text-align:center;
   top:22%;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="col-md-12"> 
    <ul id="tabs" class="nav-tabs"> 
     <li class="col-md-4 nav-list"> <a href="#" class="nav-block"> <span class="header">Lore</span> </a> </li> 
     <li class="col-md-4 nav-list"> <a href="#" class="nav-block"> <span class="header">Lorem </span> </a> </li> 
     <li class="col-md-4 nav-list"> <a href="#" class="nav-block"> <span class="header">Lorem i</span> </a> </li> 
    </ul> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials