html图像显示不出来有那几种原因?图片路径不正确、标签是否抒写正确、图片是否有中文命名等
目录
1img图片路径不正确
2html图像标签
3 html图像宽度100%,高度自适应效果
img图片路径不正确
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>通高科技</title>
<style>
#img_div{
width: 600px;
background: bisque;
height: 400px;
}
#img_div img{
width: 100%;
}
</style>
</head>
<body>
<div id="img_div">
<p>图片路径不正确</p>
<img src="https://www.tonggao001.com/templets/2022index/picture/index_1.jpg" >
</div>
</body>
</html>
html图像标签
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>通高科技</title>
<style>
</style>
</head>
<body>
<div id="img_div">
<img src="图片行径" >
</div>
</body>
</html>
html图像宽度100%,高度自适应效果
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>通高科技</title>
<style>
#img_div{
width: 600px;
background: bisque;
height: 400px;
}
#img_div img{
width: 100%;
}
</style>
</head>
<body>
<div id="img_div">
<p>图片与容器100%平铺</p>
<img src="https://www.tonggao001.com/templets/2022index/picture/index_1.png" >
</div>
</body>
</html>