【发布时间】:2022-01-23 19:38:54
【问题描述】:
*{
margin: 0px;
padding: 0px;
}
.container{
background-color:#999999;
width:100%;
margin-top: 10px;
}
.wrapper{
margin-top: 50px;
width:900px;
margin:auto;
}
.dark{
background-color: #FF4500;
height: 40px;
margin-top: 40px;
}
#top_div{
line-height: 40px;
}
#div2{
height: 220px;
}
上面提到的是我的css文件
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My static web Page</title>
<link type="text/css" rel="stylesheet" href="css1.css"/>
</head>
<body>
<div class="container">
<div class="wrapper">
<div>
<img src="img.png" width="400" height="400" ></img>
</div>
</div>
</div>
<div class="dark">
<div class="wrapper" id="top_div">
<h2>The Origin</h2>
</div>
</div>
<div class="container">
<div class="wrapper" id="top_div">
This is my styled paragraph
</div>
</div>
</body>
</html>
它只显示图像图标,在浏览器上看不到图像。 我已将图像粘贴到项目目录内的文件夹中。添加图片的正确方法是什么,请解释一下。
【问题讨论】: