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.

Recommended Answers

All 6 Replies

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

please use html code <center> 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?

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.

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

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

Thanks! That helped.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.