I have a question about html and xhtml. The following code segment
gives different layout results when embedding in html and xhtml
document respectively.
<p>
<img width="90%" height="15%" src="attblk1.gif" alt="att.gif" />
</p>
Open this page (http://spe.mobilephone.net/wit/xhtmlv2/imageattr.xhtml)
with Firefox, the 2 images following "50% and 75% of screen width wide
(15% high should be ignored resulting in normal aspect ratio, Globe
should not be stretched)" are not stretched. But if i change the
source to a normal html syntax, the 2 images are stretched.
So it must be differences between HTML and XHTML. Can anyone give me
any pointers on this?
Thanks,
Richard
For HTML 4.01, the height attribute is not ignored even when a
percentage value is given. See
<http://www.w3.org/TR/REC-html40/struct/objects.html#h-13.7.1>.
--
David E. Ross
<http://www.rossde.com/>.
Anyone who thinks government owns a monopoly on inefficient, obstructive
bureaucracy has obviously never worked for a large corporation. © 1997
> Open this page (http://spe.mobilephone.net/wit/xhtmlv2/imageattr.xhtml)
> with Firefox, the 2 images following "50% and 75% of screen width wide
> (15% high should be ignored resulting in normal aspect ratio, Globe
> should not be stretched)" are not stretched. But if i change the
> source to a normal html syntax, the 2 images are stretched.
>
> So it must be differences between HTML and XHTML. Can anyone give me
> any pointers on this?
I don't see any difference viewing the page as either XHTML or HTML.
I guess the difference with your other case "50% and 75% wide 25%
high of 100px high box" is that the computed height of the container
is an absolute length, while the computed height of the other
container is 'auto', i.e. it is not known so percentages of unknown
are effectively unknown.
--
Stanimir
> For HTML 4.01, the height attribute is not ignored even when a
> percentage value is given. See
> <http://www.w3.org/TR/REC-html40/struct/objects.html#h-13.7.1>.
Where is given the 'height' attribute is ignored for XHTML?
--
Stanimir
I have no idea what specification might say that. However, the original
message in this thread did say:
> 15% high should be ignored resulting in normal aspect ratio
I merely pointed out that, in HTML 4.01, this is not true. I gave no
opinion about XHTML.
Go back and read the entire original message.
I did read the original message and I did wonder why you didn't question
the statement you've quoted. Stating the height percentage is not
ignored for HTML alone made me think you're aware it is different for
XHTML somehow. Sorry, it could be my poor English but it haven't got
much point in the replies.
--
Stanimir