gpt4 book ai didi

html - 将div定位到css的右下角

转载 作者:行者123 更新时间:2023-11-28 00:14:15 25 4
gpt4 key购买 nike

我这里有一个旋转木马。我需要将 booton 定位在容器 NOIMAGE 的右侧,父容器应该是 .carousel-inner。

<div class="list-offers">
<div class="container">
<div class="row1">
<div class="col-xs-12 item bg_fix right" style="background-image: url(&quot;./images/bottom.jpg&quot;);">
<img class="foto" alt="Beach" title="Beach" itemprop="image" src="./images/bottom.jpg" style="display: none;">
<div class="col-xs-12 item ">
<div data-ride="carousel" class="carousel slide" id="myCarousel2">
<div class="carousel-inner">
<div class="item noimage">
<h4 itemprop="name">¡consectetuer adipiscing elit!</h4>
<p itemprop="description">Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
</div>
<div class="item noimage active">
<h4 itemprop="name">¡consectetuer adipiscing elit!</h4>
<p itemprop="description">Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
</div>
<div class="item noimage">
<h4 itemprop="name">consectetuer adipiscing elit!</h4>
<p itemprop="description">Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
</div>
</div>
<ol class="carousel-indicators">
<li class="" data-slide-to="0" data-target="#myCarousel2"></li>
<li data-slide-to="1" data-target="#myCarousel2" class="active"></li>
<li data-slide-to="2" data-target="#myCarousel2" class=""></li>
</ol>
</div>
</div>
</div>
</div>
</div>
</div>

这就是我的意图。拿起 2 个容器并尝试正确设置样式,但没有成功

.carousel-inner {
background-color: aqua !important;
position: relative !important;
width: 100%;
height: 200px;
border: 3px solid #73AD21
}

.noimage {
/*display: flex;*/
position: absolute !important;
bottom: 0 !important;
right: 0 !important;
width: 600px;
height: 100px;
background-color: blue;
border: 3px solid #73AD21
}

最佳答案

如果我没理解错的话,您是想在轮播的右下角添加一个按钮。如果是这样,该演示将显示 Bootstrap 轮播,我已将按钮绝对定位在父轮播内部容器内,如您所愿。但是,我保留了原来的 carousel-inner 属性并且没有干扰这些。

.rightBtn {
position: absolute;
bottom: 0px;
right: 0px;
background-color: teal;
color: white;
border-radius: 4px;
margin: 0px 10px 10px 0px;
padding: 10px;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

<div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">

<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
</ol>
<div class="carousel-item active">
<img class="d-block w-100" src="https://picsum.photos/300?image=28" alt="First slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="https://picsum.photos/300?image=29" alt="Second slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="https://picsum.photos/300?image=30" alt="Third slide">
</div>
<span class="rightBtn">button</span>
</div>
<a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

关于html - 将div定位到css的右下角,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55212373/

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