html-图像

html图像

示例

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>runoob</title>
</head>
<body>
<p>
images
<img src="1.gif" alt="text" width="32" height="32"></p>
<p>
插入动图和静图是一样的
</p>
</body>
</html>

HTML 图像- 图像标签和属性

在 HTML 中,图像由< img> 标签定义。
<img> 是空标签,意思是说,它只包含属性,并且没有闭合标签。
要在页面上显示图像,你需要使用源属性(src)。src 指 “source”。源属性的值是图像的 URL 地址
定义图像的语法是:

<img src="url" alt="some_text">

alt属性:简单的说明图片这是当图片无法载入时显示的简单介绍
height、width属性没必要介绍了

其他

标签 描述
<img> 定义图像
<map> 定义图像地图
<area> 定义图像地图可点击区域

实例

<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>
  • 版权声明: 本博客所有文章除特别声明外,均采用 Apache License 2.0 许可协议。转载请注明出处!

扫一扫,分享到微信

微信分享二维码
  • © 2019-2020 iteod
  • PV: UV:

请我喝杯咖啡吧~

支付宝
微信