<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
div{
position: relative;
}
p{
width: 50px;
height: 50px;
background: red;
opacity: 0.5;
position: absolute;
z-index: 999;
top: 0;
left: 0;
}
</style>
</head>
<body>
<h4>外部元素</h4>
<h4>外部元素</h4>
<h4>外部元素</h4>
<div>
<h4>内部元素</h4>
<h4>内部元素</h4>
<h4>内部元素</h4>
<p></p>
</div>
</body>
</html>
网站标题:css相对定位不占用空间
URL链接:https://www.cdcxhl.com/article20/ggocco.html
成都网站建设公司_创新互联,为您提供关键词优化、营销型网站建设、企业建站、网站收录、品牌网站设计、定制开发
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联