Hi everyone.
I was wondering, in order to get results are the same in all browsers
(or as close to the same) shoud I be using px for padding and margins
or should I be using em's. Or is there is another unit that I should
be using?
Thanks,
Terry
> I was wondering, in order to get results are the same in all browsers
This is a complete red herring. It's unimportant to achieve "the same
in all browsers" because it's fundamentally and _deliberately_
impossible to achieve the same results for all users, even with the
same browser.
The web isn't a fixed-size graphical medium. Instead it's about
supplying information content, not presentation. If it were re-
designed today by Disney, it would proabbely be different (and not so
useful).
HTML documents are declarative. They state "Here is some content,
please try to display it as best you can". They place a much lower
emphasis on the exact pixel-based positioning of things. This is a
good thing overall, as it sees delivering useful content to anywhere
as a primary goal, rather than splitting users into the "visually
identical" and the "incompatible" (who see nothing).
So your web content is going to vary. It's goign to vary between big
screens and small screens, between desktops and mobiles, between
billposter type and bible smallprint. Get over it.
As you have a significant variation to worry about (or to stop
worrying about) anyway, and browsers are now sufficiently accurate
that standards-based code renders acceptably well anywhere, then
browser-to-browser variation is no longer the significant issue. It's
still there, sometimes you might even need to know about IE's errors
and avoid triggering them. But it's not the most important thing, and
it's largely avoidable just by using good techniques and valid code.
> shoud I be using px for padding and margins
> or should I be using em's.
Same as for any good "fluid design" practices. Use ems. Use pixels for
setting widths around fixed images. Maybe use percentages for
splitting up a page. Be careful mixing units between sibling elements.
Terry meinte:
> Hi everyone.
>
> I was wondering, in order to get results are the same in all browsers
> (or as close to the same) shoud I be using px for padding and margins
> or should I be using em's. Or is there is another unit that I should
> be using?
Impossible goal. Just don't think about it. Saves you a lot of useless work.
Gregor

Signature
http://www.gregorkofler.at ::: Landschafts- und Reisefotografie
http://www.licht-blick.at ::: Forum für Multivisionsvorträge
http://www.image2d.com ::: Bildagentur für den alpinen Raum