Re: Trouble getting page to work in FireFox

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



John Bailey wrote:
The error as it turns out is that FireFox does not support setting the style.left and style.top to numbers and defaulting to pixels. Apparently you have to specifically specify "123 px" when specifying the position properties. None of the other browsers I tested (IE and Opera) had this restriction.

The standard says that all measurements needs to have a specified unit, unless the value is zero. If you omit the unit, the code is invalid, and the browser may handle it as such.

If a browser adds a default unit to properties, it's adding non-standard behaviour. As the units may not be omitted according to the standard, there are no default unit specified for different properties, and pixels is not the logical default for all properties. The font-size property for example has no singe unit that clearly would be the preferred default, and it's quite a big difference between 10px and 10em. If you write code relying on the chosen default in one browser, another browser may display the page in a completely different way, and neither of them is more right than the other.

If you keep to the standards, the page stands a better chance at displaying the same way in other browsers. After all, you can't try it in all versions of all browsers, especially as the versions of the browsers that will be used to view the page in months or years from now doesn't even exist yet.

--
Göran Andersson
_____
http://www.guffa.com
.



Relevant Pages

  • Re: Need help with loop to add numbers
    ... version of Javascript was only the most current one in Nescape ... browsers use that slightly different behavior, ... You should look into using a stylesheet, so you don't specify this ... You might also want to use the <label> element for labels: ...
    (comp.lang.javascript)
  • Re: Horizontal alignment of text in table cells
    ... Don't set a table or cell width at all. ... So the *standards compliant* browsers are ignoring the colour ... Why is it wrong to specify a font size in points but OK to specify it in ems ...
    (uk.net.web.authoring)
  • Re: Shrink-to-fit width calculation: preferred width question
    ... That div is explicitly 4em wide. ... the content regardless of the explicit width, as you were expecting, I ... spec and no other browsers to check in. ... since the spec does not precisely specify shrink-to-fit width. ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: [PHP] How to submit form via PHP
    ... The only defined behaviour is when you specify a URI. ... I welcome correction/confirmation if somebody wants to wade through the docs again... ... [PHP] How to submit form via PHP ... undocumented 'features' of specific browsers five years prior? ...
    (php.general)
  • Re: FAQ Topic - How do I modify the content of the current page? (2009-12-18)
    ... That document specifies rules serializing a fragment of HTML. ... It would have just as easy for the standard to use a new, ... Browsers that supported the *new* property name, ...
    (comp.lang.javascript)