Welcome to WebmasterWorld Guest from

Forum Moderators: not2easy

Message Too Old, No Replies

Width problems in IE

2:44 am on Nov 30, 2009 (gmt 0)

Junior Member

5+ Year Member

joined:June 16, 2007
posts: 120
votes: 0

Throughout my site I have a design which consists of a white page on a black background. To make this, I set the page background color to black, and I created a div for the content in the white box. For some reason, in IE, the width parameter doesn't work, and the box collapses and displays at a random size. Here is my code:

<div id="pageContent" style=" overflow:auto; background-image:url(background.png); top:20px; left: 20px; right:20px; display:block; width:1000px; height:500px;">
Content here.

Does anyone have any suggestions? Thanks in advance.

I hope that this is in the right forum. I think that this is a CSS problem, but I'm not sure...

3:23 am on Nov 30, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 29, 2003
posts: 1676
votes: 0

What version IE? I am not seeing "in IE, the width parameter doesn't work, and the box collapses and displays at a random size." in 7 or 8 with the markup that I plugged in.?

#pageContent {
overflow: auto; background-image: url(background.png); top: 20px; left: 20px; /*****right: 20px;*/ /******display: block;*/ width: 1000px; height: 500px;

I would question the need for {display: block;}. Are there other factors on the page that would make it useful?

A particular reason that you chose position: over margin: ?

I would also question {right: 20px;}? You've set top, left, and defined the width. What does that do for you in positioning the container?

Possible that it doesn't like the .png ? IE and .png not always best of friends.

I'm not saying that any of these choices are wrong; just asking questions.


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members