DIV by default starts new line
|
|
<!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' xml:lang='en'> <head> <title></title> <style rel='stylesheet' type='text/css'>
div#container { border: 1px solid black; margin: 0 20px; background: pink; padding: 5px; }
div#float { text-align: center; float: left; width: 150px; height: 150px; border: 1px solid blue; background: gold; } div.content { background: yellow; border: 1px solid purple; height: 150px; } div#clear { border: 1px solid red; background: orange; clear: both; } </style> </head> <body> <div id='container'> <div id='float'> Float text. </div> <div class='content'> Content text. </div> <div class='content'> Content text. </div> <div class='content'> Content text. </div> <div id='clear'> Clear text. </div> <div> Another div. </div> </div> </body> </html>
|
|
|
|
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
|