homepage Welcome to WebmasterWorld Guest from 54.145.183.169
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
Setting div width in stylesheet vs. inline
IE vs Mozilla div oddness
CTMiller

10+ Year Member



 
Msg#: 3311 posted 3:03 pm on Apr 1, 2004 (gmt 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

 

CTMiller

10+ Year Member



 
Msg#: 3311 posted 3:04 pm on Apr 1, 2004 (gmt 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.

benihana

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3311 posted 3:14 pm on Apr 1, 2004 (gmt 0)

width=300px;

heres the problem, should be

width:300px;

dave_f

10+ Year Member



 
Msg#: 3311 posted 3:16 pm on Apr 1, 2004 (gmt 0)

Hi Chris,

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

Dave

CTMiller

10+ Year Member



 
Msg#: 3311 posted 3:16 pm on Apr 1, 2004 (gmt 0)

Oy.

I'm an idiot.

Thank you. *hangs head in shame*

benihana

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3311 posted 3:18 pm on Apr 1, 2004 (gmt 0)

easily done :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved