Sunday, February 7, 2010

How to center a web page displaying in browser using CSS | for Internet Explorer 8

I faced a problem in displaying body of web page at center in Internet Explorer 8, but in other browsers like Mozilla , Chrome , the body displays at center of the window. Then finally i get to know that there are some strict way to make the page view at the center of the window.

To make the page display at the center , you must follow the steps below :

1. your html file should declared the DOCTYPE ,

2. just after the body tag , create a div and in its style attribute , write : margin:auto;


Sample code:


Download file : Sample.html

No comments:

Post a Comment

Train Schedule Info

Subscribe

Quote

"There are two blessings which many people lose: (They are) Health and free time for doing good."
[Ref: Sahih al-Bukhari - Hadith number:6412]