實際上 II 使用 HTML 和 CSS 創建了一個影像滑塊。我想創建一個彈出框。因此,在添加功能之前,我為它創建了一個布局并嘗試將其置于中心。所以當我寫 position:relative; 底部:300px(或其他)它上升但隱藏在影像滑塊后面。
.popup{
width: 900px;
height: 500px;
background-color: white;
border: 5px solid black;
position: relative;
bottom:0px;
}
<div id="slider">
<figure>
<img src="img3.jpg">
<img src="3.JPG">
<img src="4.JPG">
<img src="img3.jpg">
<img src="9.jpg" alt="">
</figure>
</div>
<center>
<div class="popup">
Dummy Text
</div>
</center>
uj5u.com熱心網友回復:
使用 z-index 指定你想要的元素在上面:
https://www.w3schools.com/cssref/pr_pos_z-index.asp
uj5u.com熱心網友回復:
只需使用絕對值設定您的位置。
.box .text{
position: absolute;
}
演示jsFiddle
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/328153.html
