Welcome to WebmasterWorld Guest from 54.197.94.30

Forum Moderators: not2easy

Setting div width in stylesheet vs. inline

IE vs Mozilla div oddness

   
3:03 pm on Apr 1, 2004 (gmt 0)

10+ Year Member



Hello all...

Got something of a silly question. I'm sure it's common, but I'd not come across it yet.

I'm trying to set the width of a div in my style.css:

helpbox {

width=300px;
border:1px solid silver;
background-color: #E9EDF7;
padding: 10px;

}

In IE, the div renders at 300px. In Mozilla, it renders at 100% of the screen width. If I set the div width inline via the style="" attribute, it works, but there are a LOT of help boxes in this app, and the idea of doing this individually fills me with horror. It doesn't seem to be a nesting problem...I can duplicate it in a blank page outside my app.

What am I missing?

My thanks,
Chris

3:04 pm on Apr 1, 2004 (gmt 0)

10+ Year Member



Sorry. The above example is missing the .

It should be:

.helpbox {

width=300px;
border:1px solid silver;
background-color: #E9EDF7;
padding: 10px;

}

Sorry for the typo. This is how it looks in my stylesheet.

3:14 pm on Apr 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



width=300px;

heres the problem, should be

width:300px;

3:16 pm on Apr 1, 2004 (gmt 0)

10+ Year Member



Hi Chris,

Try setting width:300px; - you have width=300px;

Dave

3:16 pm on Apr 1, 2004 (gmt 0)

10+ Year Member



Oy.

I'm an idiot.

Thank you. *hangs head in shame*

3:18 pm on Apr 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



easily done :)
 

Featured Threads

Hot Threads This Week

Hot Threads This Month