Welcome to WebmasterWorld Guest from 54.158.55.251

Forum Moderators: not2easy

Message Too Old, No Replies

Setting div width in stylesheet vs. inline

IE vs Mozilla div oddness

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

New User

10+ Year Member

joined:Apr 1, 2004
posts:3
votes: 0


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)

New User

10+ Year Member

joined:Apr 1, 2004
posts:3
votes: 0


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)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 13, 2003
posts:1240
votes: 0


width=300px;

heres the problem, should be

width:300px;

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

New User

10+ Year Member

joined:Dec 15, 2003
posts:6
votes: 0


Hi Chris,

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

Dave

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

New User

10+ Year Member

joined:Apr 1, 2004
posts:3
votes: 0


Oy.

I'm an idiot.

Thank you. *hangs head in shame*

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 13, 2003
posts:1240
votes: 0


easily done :)
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members