CSS_绝对定位偏移

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
div{
border: 1px solid red;
318px;
height:318px;
margin: 30px auto;
/*只设置pesition,但不设置偏移量,目的是为了让他成为子元素绝对定位的目标,并非真的让他偏移*/
position: relative;
}
/*绝对定位*/
p{
position: absolute;
bottom: 40PX;
318px;
background-color: #fff;
text-align: center;
}
</style>
</head>
<body>
<div>
<img alt="" src="../images/3.jpg">
<p>大唐长老到此一游</p>
</div>
</body>
</html>

原文地址:https://www.cnblogs.com/Bighua123/p/7591833.html