Make My Website Resize for Any Resolution

Posted on February 5th, 2011

Simply apply a relative width (= that changes with the size of the window and screen of the visitor) to the page

The most common is to use the body tag.

To adjust the page size, use this CSS code:
body{width:100%;}
With this code the page will take 100% of the window, regardless of its size.

If we define a smaller width, we can focus with “margin: auto”.

Note that
You must define a width in%, and no other unit, because the% calculated as a percentage relative to the width of the window as opposed to other units which correspond to heights of line (a predefined size ).