Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Example of CSS3 box-sizing Property</title> <style> .box { width: 50%; padding: 15px; float: left; text-align: center; background: #f0e68c; border: 5px solid #000; box-sizing: border-box; } </style> </head> <body> <div class="box">Box1</div> <div class="box">Box2</div> <p><strong>Note:</strong> If you remove the box-sizing property the boxes does not align side by side covering 50% of the viewport width, because the total width of the element also includes the padding and border area.</p> </body> </html>