【发布时间】:2020-07-28 14:58:01
【问题描述】:
对不起我的英语...
我的代码
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.min.js"> </script>
<div class="container-fluid">
<div class="row">
<div class="col">
<div class="product-grid">
<div class="product-image">
<a class="link" href="/tachen_&_rucksacke/fenster/mochila_doble_tirantes-violeta.php">
<img alt="" class="bild" src="photo/111.jpg">
</a>
</div>
<div class="product-content">
<a class="links" href="/tachen_&_rucksacke/fenster/mochila_doble_tirantes-violeta.php">
<p class="title">Mochila doble tirantes Violeta</p>
</a>
</div>
<div class="price">$16.00</div>
<div class="div-zoom">
<span class="zum-warenkorb">zum warenkorb hinzufügen</span>
<a href="#">
<i class="fa fa-search-plus" style="font-size: 94%; color: white; background-color: #595959; padding: 3%;" data-toggle="modal" data-target="#zoomWindow"></i>
</a>
</div>
</div>
<div class="modal fade" id="zoomWindow" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<button type="button" class="close text-right" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<div class="modal-body">
put here, whaterver you want
</div>
</div>
</div>
</div>
</div>
</div>
我希望在原始图像旁边打开模态窗口。
我尝试在 中使用 flex,
.modal-content {
/* Styles to make the modal visible */
display: flex !important;
opacity: 1 !important;
margin-top: 500px;
}
.modal-dialog {
justify-content: left !important;
}
.modal-content {
width: left !important;
}
但由于 modal 默认在顶部打开,所以出现了这张图片,
我想要哪个 modal 使打开的窗口居中,并且它从原始图像中打开。
请有人帮我解决这个问题,谢谢!
【问题讨论】:
-
如果你在你的项目中使用了modal,那为什么不用
bootstrapmodal呢? -
感谢您的回答!,对不起,但不明白您的意思...请您解释一下...
-
您使用的是引导程序 4 吗?如果是,bootstrap 会为您提供模态组件,更多信息请访问getbootstrap.com/docs/4.4/components/modal
-
谢谢,但在我展示此页面之前并没有找到解决我的问题的方法...
-
你想说什么?您想忽略引导模式并希望专注于您的问题吗?
标签: css bootstrap-4 bootstrap-modal