Float left in a relative positioned container
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> .container { border: 1px dotted #BAB9B8; width: 800px; overflow: hidden; margin-bottom: 20px; }
.box { background: #FFFCC4; border: 1px dotted #BAB9B8; width: 200px; height: 100px; margin: 20px; position: relative; }
.floatLeft { float: left; } .text { position: absolute; left: 0; top: 0; }
</style> </head>
<body>
<div class="container"> <div class="floatLeft box"><em class="text">Box 1</em></div> <div class="box"><em class="text">Box 2</em></div> <div class="box"><em class="text">Box 3</em></div> </div> </body> </html>
|
|
|
|
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
-
-
-
-
-
|