gpt4 book ai didi

html - 在 div 中叠加图像?

转载 作者:太空宇宙 更新时间:2023-11-04 13:56:56 24 4
gpt4 key购买 nike

这很难解释,所以我整理了这个 JSFiddle。我希望黑色 div 穿过蓝色框,以便黑色 div 位于水平蓝线下方。所以我想要 <div class="title">Testing</div>覆盖 <div class="middleFifth">

http://jsfiddle.net/Zhxt9/

提前TIA,对于错误的解释深表歉意!

最佳答案

您可以相对定位黑色div并设置z-index,使其位于蓝色div的后面(也必须在蓝色div上指定z-index)。

.title{
width:100%; float:left;
background-color:black;
position: relative;
top: -50px;
z-index: 0;
}

Updated Fiddle

关于html - 在 div 中叠加图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21790574/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com