HTML CSS examples for CSS Layout:Position
Positioning divs with unknown width
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> #container {<!-- www . j a va2s . c o m--> position:relative; left:31px; top:31px; width:401px; height:51px; outline:2px solid red; } #left { float:left; display:inline-block; height:51px; outline:3px solid blue; } #right { display:block; overflow:hidden; height:51px; outline:3px solid green; } </style> </head> <body> <div id="container"> <div id="left"> Lorem ipsum dolor </div> <div id="right"></div> </div> </body> </html>