Table-cell element's max-width value - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Cell

Description

Table-cell element's max-width value

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <title>Lorem ipsum dolor sit amet, consectetur adipisci</title> 
  <style>
#header {<!--   ww w  .j av  a 2s.c o m-->
   width:100%;
   background:Chartreuse;
}

.container {
   box-sizing:border-box;
   background:yellow;
   padding:11px 16px;
   margin:auto;
   display:table;
   width:100%;
   max-width:1501px;
   height:71px;
}

.logo {
   background:blue;
   text-align:center;
   width:71px;
   color:pink;
}

.logo, .menu {
   vertical-align:middle;
   display:table-cell;
}

.menu ul {
   text-align:right;
}

.menu ul li {
   display:inline-block;
   vertical-align:top;
}
</style> 
 </head> 
 <body translate="no"> 
  <header id="header"> 
   <div class="container"> 
    <div class="logo">
      Lorem 
    </div> 
    <nav class="menu"> 
     <ul> 
      <li> <a href="#">Lorem </a> </li> 
      <li> <a href="#">Lorem </a> </li> 
      <li> <a href="#">Lorem </a> </li> 
      <li> <a href="#">Lorem </a> </li> 
     </ul> 
    </nav> 
   </div> 
  </header>  
 </body>
</html>

Related Tutorials