Closed Bug 121659 Opened 23 years ago Closed 23 years ago

without appending 'px' the width won't change

Categories

(Core :: DOM: CSS Object Model, defect)

x86
Windows 2000
defect
Not set
minor

Tracking

()

VERIFIED INVALID

People

(Reporter: jaroslav.zaruba, Assigned: jst)

References

()

Details

From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) BuildID: 2001122106 Clicking the red rectangle should make it grow. In Mozilla this dowsn't work. Reproducible: Always Steps to Reproduce: 1. load the page 2. click the rectangle Actual Results: nothing happens Expected Results: clicking the red rectangle should enlarge it Check the JavaScript code and uncomment the line labeled 'for Mozilla' - when changing width of the DIV, in Mozilla you have to append 'px' (units) to the new value. an example // this won't work in mozilla: myElement.style.width = 300; // this will myElement.style.width = 300 + 'px';
This is invalid. You need to specify the units for any measure in CSS according to the standard, you can see it this way: what is "300" ? pixels? percentage? points? ??? if you don't say the unit then mozilla has to guess it and your guess doesn't has to be the same that mozilla's.
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
You are currently in standards layout mode invoked by your doctype. Therefore we follow the CSS2 standard which says that you *must* include a unit for every non-zero value. http://www.w3.org/TR/REC-CSS2/syndata.html#length-units As a workaround, you can remove the doctype and we will assume px. Otherwise, we follow the W3C css standards See http://www.mozilla.org/docs/web-developer/quirks/doctypes.html for our standards vs quirks mode layout sniffing. verified invalid (after midairing).
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.