im trying to stretch a div across a page. its gonna be 100% wide but when i put it in. the left and right still have white space. what do i do?

1 answer

This was chosen as the best answer

You have to set the body to have no margin. Generally, the padding is set to "0" as well. A lot of times this is done with a CSS reset or reboot file. You can find one here.

To get your 100% width to work use this CSS:

    margin: 0;
    padding: 0;
    width: 100%;
    margin: 0px;
Answered over 9 years ago by David Leininger
  • Note: ANY parent object (body, layout/wrapper divs, etc.) with padding/margin applied will need to have zero right/left values as well in order to achieve 100% browser width. Gary Hepting over 9 years ago
  • Right on the money, David. +1 Abinadi Ayerdis over 9 years ago