css相对定位不占用空间
代码:
<!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>
效果:
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。