<!DOCTYPE html>
<html lang="en">
<head>
<title>...</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<!-- My Styles -->
<style>
.boxWrap {
position: relative;
}
.boxItem {
position: absolute;
}
h1 {
color: white;
}
</style>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-12 boxWrap">
<div class="boxWrap">
<img src="01.png" class="img-fluid boxItem" alt="">
</div>
</div>
<div class="col-12 boxWrap">
<div class="boxWrap">
<img src="01.png" class="img-fluid boxItem" alt="">
</div>
</div>
<div class="col-12 boxWrap">
<div class="boxWrap">
<img src="01.png" class="img-fluid boxItem" alt="">
<h1 class="boxItem">hello</h1>
</div>
</div>
<div class="col-12 boxWrap">
<div class="boxWrap">
<img src="01.png" class="img-fluid boxItem" alt="">
<h1 class="boxItem">hello</h1>
</div>
</div>
</div>
</div>
</body>
</html>
好吧,我一直試圖通過使用CSS中的position屬性來放置文本和圖像。基本上,我給圖像的父母「相對」的值和「絕對」值的圖像。事實證明,無論我在第一個「boxWrap」div之後放置了多少元素,它們總是被放置在該類的第一個div的頂部。我怎樣才能恢復正常的頁面流?在CSS上使用位置屬性後,圖像被置於彼此之上
您能否展示圖像如何相互映照的快照?另外,你預計會發生什麼? –