img标签宽度,高度属性是否必要? [英] img tag width, height attributes necessary?

查看:98
本文介绍了img标签宽度,高度属性是否必要?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于< img>标签,是必要的宽度和高度属性?他们只能省略
吗?


dm

For <img> tags, are the width and height attributes necessary? Could they just
be omitted?

dm

推荐答案

On Thu ,2004年11月4日10:07:31 -0800,DM< elektrophyte-yahoo>写道:
On Thu, 04 Nov 2004 10:07:31 -0800, DM <elektrophyte-yahoo> wrote:
For< img>标签,是必要的宽度和高度属性?可以吗?
它们只是被省略了?
For <img> tags, are the width and height attributes necessary? Could
they just be omitted?




它们不是必需的,但我建议使用它们。


没有这个在HTML中的信息,UA无法解释图像所需的视频空间。结果,如果

用户正在读取图像下方,则UA突然发现尺寸

并且整个页面令人不安地跳跃。


确保高度和宽度的值是所用图像的精确

像素尺寸非常重要。不要在

浏览器中调整图像大小,这会导致下载量超出需要(当HTML

减小尺寸时)或像素化丑陋图像(当HTML时)增加尺寸。



They are not required but I recommend their use.

Without this information in the HTML, the UA cannot account for the
viewport space needed for the image. As a result, it happens that if the
user is reading below the image, suddenly the UA discovers the dimensions
and the whole page jumps disconcertingly.

And it''s important to be sure the values of height and width are the exact
pixel dimension of the image being used. Don''t resize images in the
browser, it leads to either a heftier download than is needed (when HTML
reduces size) or a pixellated ugly image (when HTML increases size).


2004年11月4日星期四13:28:12 -0500,Neal< ne ***** @ yahoo.com>写道:
On Thu, 04 Nov 2004 13:28:12 -0500, Neal <ne*****@yahoo.com> wrote:
On Thu,2004年11月4日10:07:31 -0800,DM< elektrophyte-yahoo>写道:
On Thu, 04 Nov 2004 10:07:31 -0800, DM <elektrophyte-yahoo> wrote:
For< img>标签,是必要的宽度和高度属性?可以吗?
For <img> tags, are the width and height attributes necessary? Could
they just be omitted?



它们不是必需的,但我建议使用它们。



They are not required but I recommend their use.




和道歉对于交叉路口 - 后续现在设置为ciwah。



And apologies for the crosspost - followups are now set to ciwah.


Neal写道:
Neal wrote:
On Thu,2004年11月4日10:07 :31 -0800,DM< elektrophyte-yahoo>写道:
On Thu, 04 Nov 2004 10:07:31 -0800, DM <elektrophyte-yahoo> wrote:
For< img>标签,是必要的宽度和高度属性?可以吗?
For <img> tags, are the width and height attributes necessary? Could
they just be omitted?



它们不是必需的,但我建议使用它们。

如果没有HTML中的这些信息,UA就不能说明图像所需的视口空间。结果,如果
用户正在读取图像下方,UA会突然发现尺寸,整个页面会令人不安地跳起来。

它是重要的是要确保高度和宽度的值是所用图像的精确像素尺寸。不要在浏览器中调整图像大小,这会导致下载量超出需要(当HTML缩小尺寸时)或像素化丑陋图像(当HTML增加大小时)。


They are not required but I recommend their use.

Without this information in the HTML, the UA cannot account for the
viewport space needed for the image. As a result, it happens that if the
user is reading below the image, suddenly the UA discovers the
dimensions and the whole page jumps disconcertingly.

And it''s important to be sure the values of height and width are the
exact pixel dimension of the image being used. Don''t resize images in
the browser, it leads to either a heftier download than is needed (when
HTML reduces size) or a pixellated ugly image (when HTML increases size).




感谢您的回复。在一个相关的问题上,如果你提供宽度和高度

属性,你是否使用< img>是否重要?标签或CSS属性?



Thanks for the reply. On a related question, if you do provide width and height
attributes, does it matter whether you use <img> tag or CSS attributes?


这篇关于img标签宽度,高度属性是否必要?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆