gpt4 book ai didi

html - bootstrap 3 z-index 将一个 div 放在另一个 div 上

转载 作者:行者123 更新时间:2023-11-28 16:17:47 24 4
gpt4 key购买 nike

我试图在 bootstrap 中将一个 div 放在另一个 div 上,我没有更改任何 bootstrap 的 css,所以下面的所有代码都是 bootstrap,没有添加自定义 css。

<div class="col-lg-3 listing-panel side-bar-for-single-listing" style="margin-top: 10px;">

<div class="col-lg-12" style="z-index: 999; background: red; height: 40%;"> </div>

<form class="col-lg-12" style=" ">

<legend>Contact</legend>

<div class="form-group">
<label for="IDinputName">Name*</label>
<input type="text" class="form-control" id="IDinputName" placeholder="Name">
</div>

<div class="form-group">
<label for="IDinputMobile">Mobile*</label>
<input type="text" class="form-control" id="IDinputMobile" placeholder="Mobile" >
</div>

<div class="form-group">
<label for="IDinputMessage">Message*</label>
<textarea id="IDinputMessage" class="form-control" style="height: 100px;"></textarea>
</div>



<button type="submit" id="IDcontactSubmitBtn" class="btn btn-primary">Send</button>

</form>

</div>

这是我目前拥有的,我希望红色框覆盖 100% 的表单元素:

enter image description here

最佳答案

让我们试试吧!我希望它能有所帮助! :)

<div class="col-lg-12" style="background: red none repeat scroll 0% 0%; position: absolute; left: 0px; top: 0px; height: 100%; z-index: -1; right: 0px; margin: 0px auto;"> </div>

关于html - bootstrap 3 z-index 将一个 div 放在另一个 div 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37374051/

24 4 0