Flexbox bound two elements to each side left and right - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Flex

Description

Flexbox bound two elements to each side left and right

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <title>Poor man's flex box mimic</title> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
div {<!--from  ww  w. j ava2s .  c  o  m-->
   position:relative;
   outline:2px dotted gray;
}

div span {
   background:green;
   display:inline-block;
   color:Chartreuse;
   padding:21px 31px;
}

div .left {
   position:absolute;
   left:0;
   top:0;
}

div .right {
   position:absolute;
   right:0;
   top:0;
}
</style> 
 </head> 
 <body> 
  <div class="two-columns"> 
   <span class="left">1</span> 
   <span class="right">2</span> 
  </div>  
 </body>
</html>

Related Tutorials