954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

div width is different in IE vs Firefox&Chrome

The website I am designing is made up of several div tags. All but one are at width of 1000 pixels. The odd one out has a width of 990 pixels. All divs are centered.

On firefox and chrome, the divs show up centered and the 990 px width div looks the same width as the 100px divs. But on IE, the 990px div shows up as exactly 990px, i.e. the other dis look longer that said div.

What's going on?

I don't know if I can post the code (work policies).

Thanks.

asuprem
Newbie Poster
20 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
 

please use html code or CSS margin:auto; to centerize the divs.

lps
Junior Poster
117 posts since Jul 2011
Reputation Points: 13
Solved Threads: 22
 
please use html code or CSS margin:auto; to centerize the divs.

All the divs are centered. Here is my problem:

1. On firefox and chrome, divs are centered, but NOT on IE
2. the div with width 990px appears the same length as the divs with width 1000px on firefox and chrome, but NOT on IE.

What can I add to my div codes to center in IE?

What is up with the differing length appearances?

asuprem
Newbie Poster
20 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
 

May I know which version of IE you are using? Based on my experience, these problems exist basically cause by margin problem or the doctype.

lps
Junior Poster
117 posts since Jul 2011
Reputation Points: 13
Solved Threads: 22
 

I am using IE9, but most users with IE will be using version 8

asuprem
Newbie Poster
20 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
 

1. declare the doctype before tag: .
2. add css margin:auto; to divs
Normally these should fix the problem.

lps
Junior Poster
117 posts since Jul 2011
Reputation Points: 13
Solved Threads: 22
 

Thanks! That helped.

asuprem
Newbie Poster
20 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: