<img>定义HTML页面中图像
<img src="" alt="" tittle="" width="" height="">
<img>是单标签
属性:
1、src:路径
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<img src="p2831307612.jpg">
</body>
</html>
2、alt:规定图像的代替文本(当图片无法显示时)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<img src="p2831307612.jg" alt="喜羊羊与灰太狼之筐出未来">
</body>
</html>
3、width:规定图像的宽度
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<img src="p2831307612.jpg" alt="喜羊羊与灰太狼之筐出未来" width="400px">
</body>
</html>
4、height:规定图像的高度
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<img src="p2831307612.jpg" alt="喜羊羊与灰太狼之筐出未来" width="400px" height="500px">
</body>
</html>
5、title:鼠标悬停在图片上给予提示
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<img src="p2831307612.jpg" alt="喜羊羊与灰太狼之筐出未来" width="400px" height="500px" title="大电影海报">
</body>
</html>