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



It is IT related blog site and Experiences of Zahid Bin A. Rouf, which has posts on technology,tips and tricks,links,troubleshoot,tutorials,computer related suggestions,reviews


Like Us

Bangladesh-data Blog
CodeInclude Blog
TicTacToe Game

Bangladesh Info


"There are two blessings which many people lose: (They are) Health and free time for doing good."

~Narrated by Ibn 'Abbas
~Said by Prophet Muhammad (sallallahu alayhi wasallam)
[Ref: Bukhari Hadith:Volume 8, Book 76:Softening the Heart, Number 421 ]

Pageviews last month