File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Padding in firefox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Padding in firefox" Watch "Padding in firefox" New topic

Padding in firefox

Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
when I set my style attribute in-line like so:

in i.e the padding looks fine, but in firefox it pads from the left
but the right end of the object grows too .

what am I doing wrong?

is that padding format only valid in i.e is there a better way to do it?




the object is a div.
[ June 09, 2008: Message edited by: Bear Bibeault ]

You down with OOP? Yeah you know me!
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Are you setting a doc type on your page?

Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802

what it is is I have a table that I'm making 'dynamically' and in each cell there is a div that is getting certain style attributes set inline.

could the fact that it is inside a cell have a problem in ff and not ie?

Katrina Owen

Joined: Nov 03, 2006
Posts: 1367
Tables can be a real pain!

First of all, they have a bunch of properties that apply to some elements but not others, and some properties that are specific to tables, and tables apply the box model differently than all other elements (as far as I've been able to determine, anyway).

So in summary: yes, it could very well be due to the table.

Could you show a section of code along with the CSS you've defined?
Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
Yep, I'll find it comment it really well, and post it later today : ).

Thanks for wanting to help,

Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
basically it is something like this...

#CSS Class

And basically, in firefox when I pad that 5px from the left of the div the
div actually expands 5px to the right also (what I don't want).

But in IE the padding does just fine, and the div doesn't grow (like I like it ).

Thanks again,

Justin Fox
[ June 10, 2008: Message edited by: Justin Fox ]
I agree. Here's the link:
subject: Padding in firefox
It's not a secret anymore!