Positioning inline-block divs side by side that contain inline content - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Position

Description

Positioning inline-block divs side by side that contain inline content

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <title>Lorem ipsum dolor sit amet, consectetur adipis</title> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
header {<!--from   w w  w  .j ava  2  s. c  o m-->
   width:100%;
   height:801px;
   background-color:Chartreuse;
}

#titlebar {
   width:100%;
   height:201px;
   background-color:yellow;
}

#titlename {
   width:50.6%;
   height:100%;
   background-color:blue;
   opacity:0.91;
   display:inline-block;
   vertical-align:top;
}

#titlemenu {
   width:50.6%;
   height:100%;
   background-color:pink;
   display:inline-block;
}
</style> 
 </head> 
 <body> 
  <header> 
   <div id="titlebar"> 
    <div id="titlename"> 
     <h1>Lorem ipsum dol</h1> 
    </div> 
    <div id="titlemenu"> 
     <span>Lorem ip</span> 
     <span>Lorem ip</span> 
    </div> 
   </div> 
  </header>  
 </body>
</html>

Related Tutorials