Adjusting your websites to fit all types of resolution

Last update on April 8, 2009 08:30 AM by jak58
Published by jak58

Adjusting your websites to fit all types of resolution







"How to adjust my site to the visitor's resolution and what resolution to choose?"

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.
You can adapt it if you use a div # body or another.

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.

We can obviously set the width you want (90%, 80%, etc.).

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

Note

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 ).


While it is important that your page is not smaller than a certain size, one can use the min-width property (which does not work in IE).

You can also use max-width to set the maximum size.
(I do not recommend this practice because it is not pleasant to have a page that is smaller than the window I think)
Example

A page width of 90%, centered, a minimum width of 600 pixels and a maximum width of 2000 pixels:

  body{width:90%;margin:auto;min-width:600px;max-width:2000px}
Best answers for « Adjusting your websites to fit all types of resolution » in :
Download Power Search Tool Show Power Search Tool allows you to perform your researches on Internet faster and more efficiently. He will help you to find Websites, different types of files, particular pictures, all kinds of videos, documents and many others. Power Search Tool...
Re-adjusting the size of an image in pixels ShowRe-adjusting the size of an image in pixels IF you want to adjust an image, according to a specific number of pixels. You can use the Paint.NET software to achieve this manipulation. Link: http://www.getpaint.net/ After installing the...
Publish a PDF file on your website ShowPublish a PDF file on your Website Displaying a link to a PDF on your Website Displaying the PDF on your website Displaying a link to a PDF on your Website Proposing a PDF link on your own website is an operation that can seem...
Reducing a Jpg image size ShowReducing a Jpg image size Step 1 (optional!): Skip GREYCstoration on the image Step 2: Reduce the resolution Step 3: Lower quality Step 4: Remove unnecessary information Conclusion If you find that your JPEG files are too large...
Download Addictive Typing Lessons ShowThe blind seizure with the cooperation of the ten fingers of the hand will not be any more a dream or a fantasy. Addictive Typing Lessons is an extension Firefox which will help you to gain knowledge of the blind seizure by using all your...
Types of computers ShowTypes of computers There are several families of computers, depending on their format: Mainframes, computers which a great deal of computing power, enormous input-output capabilities and high level of reliability. Mainframes are used by large...
Types of networks ShowDifferent types of networks Different types of (private) networks are distinguished based on their size (in terms of the number of machines), their data transfer speed, and their reach. Private networks are networks that belong to a single...
XD picture card ShowxD Picture card xD Picture memory (for eXtreme Digital) is a type of memory card created by Fuji and Olympus in August 2002. The architecture of xD cards is based on NAND type flash memory circuits (EEPROM) xD picture card memory is...