HTML图像<img>

时间:2015-10-13 15:03:58   收藏:0   阅读:2810

使用举例

<img src="pulpit.jpg" alt="Pulpit rock" width="304" height="228">

属性

实例:

<p>An image:<img src="smiley.gif" alt="Smiley face" width="32" height="32"></p>
<h4>Image with default alignment (align="bottom"):</h4>
<p>This is some text. <img src="smiley.gif" alt="Smiley face" width="32" height="32"> This is some text.</p>

<h4>Image with align="middle":</h4>
<p>This is some text. <img src="smiley.gif" alt="Smiley face" align="middle" width="32" height="32"> This is some text.</p>

<h4>Image with align="top":</h4>
<p>This is some text. <img src="smiley.gif" alt="Smiley face" align="top" width="32" height="32"> This is some text.</p>

<p><b>Note:</b> The align attribute is deprecated in HTML 4, and is not supported in HTML5. Use CSS instead.</p>
<p>创建图片链接:
<a href="http://www.w3cschool.cc/html/html-tutorial.html">
<img src="smiley.gif" alt="HTML 教程" width="32" height="32">
</
a>
</
p>
<img src="planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap">

<map name="planetmap">
  <area shape="rect" coords="0,0,82,126" alt="Sun" href="sun.htm">
  <area shape="circle" coords="90,58,3" alt="Mercury" href="mercur.htm">
  <area shape="circle" coords="124,58,8" alt="Venus" href="venus.htm">
</map>
    注:<map> 标签用于客户端图像映射。图像映射指带有可点击区域的一幅图像。
    <img>中的 usemap 属性可引用 <map> 中的 id 或 name 属性(取决于浏览器),所以我们应同时向 <map> 添加 id 和 name 属性。
    area 元素永远嵌套在 map 元素内部。area 元素可定义图像映射中的区域。

原文:http://www.cnblogs.com/zhiupping8/p/4874518.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!