HighDots Forums  

Re: Can Somebody Check This?

Javascript JavaScript language (comp.lang.javascript)


Discuss Re: Can Somebody Check This? in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ivo
 
Posts: n/a

Default Re: Can Somebody Check This? - 05-04-2004 , 07:31 AM






"Evertjan." wrote
Quote:
[declare "px" in sizes]
img src="1.jpg" name="moviePic" width="640px" height="416px"
First time I 've seen units declared in simple width and height attributes.
Are you not confused with widths and heights coming from css? But I tried
and found it works (tested in IE6)!
How far backward compatible is this? I 'm sure this wasn't necessary before.
Ivo




Reply With Quote
  #2  
Old   
Michael Winter
 
Posts: n/a

Default Re: Can Somebody Check This? - 05-04-2004 , 07:49 AM






On Tue, 4 May 2004 13:31:06 +0200, Ivo <no (AT) thank (DOT) you> wrote:

Quote:
"Evertjan." wrote

[declare "px" in sizes]
img src="1.jpg" name="moviePic" width="640px" height="416px"

First time I 've seen units declared in simple width and height
attributes.
Are you not confused with widths and heights coming from css? But I
tried and found it works (tested in IE6)!
How far backward compatible is this? I 'm sure this wasn't necessary
before.
You are correct: it wasn't and isn't necessary. In fact, I believe it's
erroneous.

The width and height attributes for the IMG element are of type "Length".
Length may either be a "Pixel" value or a percentage. Therefore,
width="640" is automatically stating 640 pixels. No units are necessary,
and are probably incorrect if used.

Mike

--
Michael Winter
M.Winter (AT) blueyonder (DOT) co.invalid (replace ".invalid" with ".uk" to reply)


Reply With Quote
  #3  
Old   
Michael Daly
 
Posts: n/a

Default Re: Can Somebody Check This? - 05-04-2004 , 12:06 PM



On 4-May-2004, Michael Winter <M.Winter (AT) blueyonder (DOT) co.invalid> wrote:

Quote:
width="640" is automatically stating 640 pixels. No units are necessary,
and are probably incorrect if used.
Specifying the default in most languages is rarely incorrect even if unnecessary.
It just helps to make the information very specific. HTML and its variants
specify that "px" is a legitimate qualifier; why should it be incorrect to use it?

Mike


Reply With Quote
  #4  
Old   
Lasse Reichstein Nielsen
 
Posts: n/a

Default Re: Can Somebody Check This? - 05-04-2004 , 12:15 PM



"Michael Daly" <michaelDaly (AT) foo (DOT) bar> writes:

Quote:
On 4-May-2004, Michael Winter <M.Winter (AT) blueyonder (DOT) co.invalid> wrote:

width="640" is automatically stating 640 pixels. No units are necessary,
and are probably incorrect if used.
....
Quote:
HTML and its variants specify that "px" is a legitimate qualifier;
why should it be incorrect to use it?
No it doesn't.
<URL:http://www.w3.org/TR/html4/types.html#h-6.6>
The valid values of an HTML length is either pixels (a plain number) or
percentages (a number with "%" after).

Units like "px" are CSS, not HTML. You can use them in they style tag,
but that is CSS content. It should not be used in the width property
(but one should use CSS instead of the width property in any case -
it's even deprecated on HR, TD, TH, and PRE elements).

/L
--
Lasse Reichstein Nielsen - lrn (AT) hotpop (DOT) com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'


Reply With Quote
  #5  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: Can Somebody Check This? - 05-25-2004 , 01:14 AM



Ivo wrote:

Quote:
"Evertjan." wrote
[declare "px" in sizes]
img src="1.jpg" name="moviePic" width="640px" height="416px"

First time I 've seen units declared in simple width and height attributes.
Are you not confused with widths and heights coming from css? But I tried
and found it works (tested in IE6)!
That's one of the Bad Things about IE for developers:
It turns every sh*t into gold.

Quote:
How far backward compatible is this?
I 'm sure this wasn't necessary before.
It is worng, simple as that.


PointedEars


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.