HTML CSS examples for CSS Layout:Float
Stack right floats
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> #container {<!--from w ww . j a v a 2 s. c o m--> width: 400px; margin:auto; background:red; overflow: hidden; } #head { width: 100%; height:30px; background:purple; } #content { width: 190px; background:black; float:left; margin: 0 0 0 5px; } #content2 { float: right; } #side1 { width:190px; background:red; margin:0 5px 10px 0; }#side2 { width:190px; background:red; margin:0 5px 10px 0; } #side3 { width:190px; background:red; margin:0 5px 10px 0; } </style> </head> <body> <div id="container"> <div id="head"> header </div> <div id="content"> the quick brown fox the quick brown fox the quick brown fox the quick brown fox the quick brown fox </div> <div id="content2"> <div id="side1"> this is a test this is a test this is a test this is a test </div> <div id="side2"> this is a test this is a test this is a test this is a test </div> <div id="side3"> this is a test this is a test this is a test this is a test </div> </div> </div> </body> </html>