代码:
<!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>定位</title>
<style>
body {
background-color:rgb(218, 213, 206);
}
#box{
height: 450px;
width: 400px;
background-color: white;
position: relative;
margin: 0 auto;
}
#a{
border-bottom: 1px grey solid;
text-align: center;
padding-top:10px;
padding-bottom: 10px;
}
#tp{
width:300px;
height:400px;
padding-top: 40px;
margin: 0 auto;
}
#b{
width: 298px;
margin: 0 auto;
top: 290px;
left:50px;
position: absolute;
border: 1px grey solid;
border-top: 0px;
}
#logo{
right: 70px;
top:105px;
position: absolute;
}
#wen{
color: white;
position: absolute;
top:-15px;
right: 4px;
}
</style>
</head>
<body>
<div id="box">
<div id="a">
<p>前端开发</p>
</div>
<div id="tp">
<img width=300px;height=400px; src="images/01.jpg">
</div>
<div id="b">
<p>Web前端学习</p>
<p style="color:orange; ">您就是未来的前端工程师</p>
</div>
<div id="logo">
<img src="images/label.png">
<p id="wen">点播</p>
</div>
</div>
</body>
</html>
实现结果: