How to face your web site for wide screen

Posted Oct 28, 2009 by pasanbuddhika / comments 1 comments / Print / Font Size Decrease font size Increase font size

If you create your web site in your computer and you test it in your computer relevant your screen resolution. But some one see your web site which wider than your screen what happen to your web site and how he (or she) accept that. Do you think about that?

When I’m creating a web page in local machine I do it relevant to my screen resolution. For an example I use 1024*768 screen resolution.  My web page works well in my computer because I make it relevant to it. There is no matter.

But problem begins when I publish it. Different people use different screens. Some are larger, some are larger also use wide screens. When they visit my web site and sometimes the see what I'm not expected.

What can we do for avid that. We can decide the width of our site and limit it to that width. But there is another problem. When we limit the width of the site it shows align to left in wide screen.

We can use simple CSS method to avoid both of these problems. Using these methods we can limit the width of the web site and it aligns to center.

We use div to limit the width of the site. I use name 'container' (as many others use) for the ID of that div. We can set the div width to fixed value using simple CSS method. I fixed it to 1000 pixels.

     #container {
      width:1000px;
     }

Now I want to align that div to center. We can modify above css style to do that. Change it as follows.

     #container {
       width:1000px;
       margin-left:auto;
       margin-right:auto;
     }

Now style is completed. Now put your site content between the div tag.

It's simple but very important. Keep it in your mind and use it when you creating web site.

Rate this Article:

Be the first to rate me.

  • Nothing Found!

    Why not submit your own content? Signup here.

  • Nothing Found!

    Why not submit your own content? Signup here.


* You must be logged in order to leave comments, please login or join us.

Comments

wapasan
wapasan said... on November 4th, 2009 at 2:13 PM

hai ! nice article dO MORE for us



Bookmark and Share
Sign up for our email newsletter
Name:
Email: