Archive for January, 2009

Get­ting CSS rules to work across all browsers is a con­tin­u­ous fight. Thank­fully, there are workarounds and DHTML meth­ods to cor­rect many of these prob­lems, and if those fail, reluc­tantly there are hacks avail­able. Unfor­tu­nately, it seems I’ve run into a dif­fer­ence of opin­ion between the browsers, most likely as a result of the W3 Con­sor­tium fail­ing (yet again) to be explicit with their stan­dards. The prob­lem is the dif­fer­ence between the way Fire­fox and Opera inter­pret the “word-spacing” CSS prop­erty ver­sus the way Safari and IE inter­pret the prop­erty. More specif­i­cally each browser treats the non-breaking space dif­fer­ently. FF/Opera both respect the non-breaking space and Safari/IE both ignore the space. For exam­ple, if the text is “first foo bar last”, FF/Opera would like:

first        foo bar       last

whereas in Safari/IE the text would appear like:

first        foo        bar        last

Per­son­ally, I agree with the FF/Opera devel­op­ers and feel that the non-breaking space should be respected since I’m explic­itly telling the browser that words to either side of the non-breaking space should be treated as a unit. So now I’m going to have to put each phrase in some sort of HTML block and depend on a com­bi­na­tion of padding and mar­gins to accom­plish the same effect in order for it to be cross-browser compatible.