HTML CSS examples for CSS Widget:Div
Two divs on left and right in parent, right with fixed width, left fill free space, both in same line
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .container {<!--from w w w .j ava 2 s.co m--> width:501px; background-color:Chartreuse; height:51px; display:table; } .container .left { background-color:yellow; height:51px; display:table-cell; width:100%; } .container .right { background-color:blue; width:51px; height:51px; display:inline-block; vertical-align:text-top; } </style> </head> <body> <div class="container"> <div class="left"> Lorem ipsum dolor sit amet, cons </div> <div class="right"> Lorem ipsum d </div> </div> </body> </html>