HTML CSS examples for CSS Layout:Width
100% width div with padding
<html> <head> <style type="text/css"> .red-box {background:red;width:100%} .red-box .inner {padding:10px} .blue-box {background:blue;box-sizing:border-box;width:100%;padding:10px} </style> </head> <body> <div class="red-box"> <div class="inner"> This is one way to tackle the problem </div> </div> <div class="blue-box"> This is another <!-- w ww. j av a2s. c om--> </div> </body> </html>