HTML width / height属性和img元素上的CSS width / height属性有什么区别?

HTML< img>元素可以具有width / height属性,并且还可以具有CSS width / height属性.
<img src="xxx.img" width="16" height="16" 
style="width: 16px; height: 16px"></img>

HTML属性和CSS属性有什么区别,应该具有相同的影响?

解决方法

关于这个问题的热门辩论可以在这里找到: Width attribute for image tag versus CSS

把它们加起来:

The gain from declaring a width value
and an height value (which may not be
the original physical dimensions of
the image) or from css declarations
(like width: [valueX]; height:
[valueY];) is that it helps speed up
the rendering of the page. The browser
kNows how much space to allocate a
particular area of the page: it will
even draw image placeholders on a
first draw,a first parsing+rendering
of the page. When one does not define
any width and height,then the browser
has to download the image and then
figure out its dimensions,space to
allocate and then redraw the page.

这似乎是我看来最有利的效果.

相关文章

vue阻止冒泡事件 阻止点击事件的执行 &lt;div @click=&a...
尝试过使用网友说的API接口获取 找到的都是失效了 暂时就使用...
后台我拿的数据是这样的格式: [ {id:1 , parentId: 0, name:...
JAVA下载文件防重复点击,防止多次下载请求,Cookie方式快速简...
Mip是什么意思以及作用有哪些