<img src="/i/eg_mouse.jpg" width="128" height="128" />
<img src="/i/eg_cute.gif" width="50" height="50" />
<img src="/i/ct_netscape.jpg" />
<img src="http://www.w3school.com.cn/i/w3school_logo_white.gif" />
<body background="/i/eg_background.jpg">
<body background="/i/eg_background.jpg"></body>
<img src="/i/eg_cute.gif" align="middle">
<img src ="/i/eg_cute.gif" align ="left">
<p>通过改变 img 标签的 "height" 和 "width" 属性的值,您可以放大或缩小图像。</p>
为图片显示替换文本。在浏览器无法载入图像时,替换文本属性alt告诉读者们失去的信息。为页面上的图像都加上替换文本属性是个好习惯。
<img src="/i/eg_goleft.gif" alt="向左转" />
制作图像链接
<a href="/example/html/lastpage.html"><img border="0" src="/i/eg_buttonnext.gif" /></a>
创建带有可供点击区域的图像地图。其中的每个区域都是一个超级链接。
注释:img 元素中的 "usemap" 属性引用 map 元素中的 "id" 或 "name" 属性(根据浏览器),所以我们同时向 map 元素添加了 "id" 和 "name" 属性。
<img src="/i/eg_planets.jpg" border="0" usemap="#planetmap" alt="Planets" />
<map name="planetmap" id="planetmap">
<area shape="circle" coords="180,139,14" href ="/example/html/venus.html" target ="_blank" alt="Venus" />
<area shape="circle" coords="129,161,10" href ="/example/html/mercur.html" target ="_blank" alt="Mercury" />
<area shape="rect" coords="0,0,110,260" href ="/example/html/sun.html" target ="_blank" alt="Sun" />
</map>
把一幅普通的图像设置为图像映射
<a href="/example/html/html_ismap.html"><img src="/i/eg_planets.jpg" ismap /></a>