Input
Output
<!DOCTYPE html> <html lang="en"> <head> <style> .container { width: 100%; background-color: lightgray; } .box { float: left; width: 30%; margin: 10px; padding: 20px; } .box1 { background-color: lightblue; } .box2 { background-color: lightgreen; } .box3 { background-color: lightcoral; } /* Clearfix */ .container::after { content: ""; display: table; clear: both; } </style> </head> <body> <div class="container"> <div class="box box1">Box 1</div> <div class="box box2">Box 2</div> <div class="box box3">Box 3</div> </div> </body> </html>