Home
HTML
HTML Div
Tryit: using float
Run ❯
Get your
own
website
Result Size:
625 x 534
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <style> div.mycontainer { width:100%; overflow:auto; } div.mycontainer div { width:33%; float:left; } </style> <body> <div class="mycontainer"> <div style="background-color:#FFF4A3;"> <h2>London</h2> <p>London is the capital city of England.</p> <p>London has over 9 million inhabitants.</p> </div> <div style="background-color:#FFC0C7;"> <h2>Oslo</h2> <p>Oslo is the capital city of Norway.</p> <p>Oslo has over 700,000 inhabitants.</p> </div> <div style="background-color:#D9EEE1;"> <h2>Rome</h2> <p>Rome is the capital city of Italy.</p> <p>Rome has over 4 million inhabitants.</p> </div> </div> </body> </html>