Monday 11 October 2004 7:56:23 am
As the differences in CSS support between browsers can become very frustrating, and hard to deal with, I posted the eZBrowserSniff operator (which came to life, due to the tremendous amount of help Paul F. provided me) to detect which browser is accessing the page, and present a style sheet specific to that browser. This allows a developer to set up a core style sheet (or set of style sheets), and then have some style sheets that 'fix' problems in certain browsers.
<b>Example</b> I have a div that needs to be of a specific width (500 pixels), but it also needs to use padding (10 pixels per side); the different browsers will treat this div differently. DOM compliant browsers will actually add all of the values together, so I would end up with a div that is 520 pixels wide (10px padding + 500px div + 10px padding), whereas IE will keep it at 500 pixels. So, I can create two style sheets, one for DOM compliant browsers, which set the width at 480px, and one for IE which sets the width at 500px. <b>eZBrowserSniff:</b> http://ez.no/community/contributions/template_plugins/ezbrowsersniff_operator
Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]
<i>When in doubt, clear the cache.</i>
|