Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / CSS / August 2007



Tip: Looking for answers? Try searching our database.

Achieving same results in all browsers

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Terry - 29 Aug 2007 18:34 GMT
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
Andy Dingley - 30 Aug 2007 17:28 GMT
> 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.
Gregor Kofler - 31 Aug 2007 17:59 GMT
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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.