Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Width Problem With FireFox

Status
Not open for further replies.

BoulderBum

Programmer
Jul 11, 2002
2,179
US
I'm trying to set div widths on FireFox and it's just ignoring me! Ack!

What is the proper way to do this:

Code:
<div style="width: 10em; float: left">
   FireFox ignores my width, darn it!
</div>
<div style="width: 10em; float: left">
   It gets annoying because nothing is aligned properly.
</div>
 
What's not working? I get expected results in my Mozilla. What reincarnation of FF are you using?
 
It's FireFox 1.0.7.

More accurately, I have several spans with various widths contained within a div, and the problem is that I want it to be so wide no matter what, but if there's extra whitespace, FireFox seems to eat it up and wreck the alignment.

I'll see if I can get a concrete example out shortly.
 
That's the problem with mock examples. If they are not detailed enough they might not show the problem in question. Are you giving spans a width? Because then FF is correct in ignoring it, since span as an inline element cannot have width.
 
I see. What I'm doing is using a .NET label control which renders as a span with attributes applied. This works in IE but knowing the reason it didn't work in FireFox is very helpful.

I assume your recommendation would be to just use a div instead?
 
Well, I don't know exactly what you're doing. Maybe lists are the best way to go. One way or another, if it is many elements in one line, it will be some block level floated and if there's just one element per line, it will just be a block level element.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top