gpt4 book ai didi

css - 模态窗口中的图像 - 如何将模态宽度设置为自动?

转载 作者:太空宇宙 更新时间:2023-11-04 10:47:29 25 4
gpt4 key购买 nike

我有带图像的模态窗口,一切正常,但对于某些图像,我在图像右侧出现空白。

示例:http://www.bootply.com/yjIFNRdcF1

<a data-toggle="modal" data-target="#full-flyer-120" href="#">CLICK ME</a>

<div class="modal fade" id="full-flyer-120" tabindex="-1" role="dialog" aria-labelledby="full-flyer-120Label" style="display: none;">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<img class="img-responsive" src="http://portalwiedzy.onet.pl/_i/mendelejew.jpg" alt="Full mendelejew">
</div>
</div>
</div>
</div>

我怎样才能改变它,使模态窗口与图像大小相同?

最佳答案

只需将以下内容添加到您的样式表即可。

.carousel-inner>.item>a>img, .carousel-inner>.item>img, .img-responsive, .thumbnail a>img, .thumbnail>img {
display: block;
width: 100%;
height: auto;
}
<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<a data-toggle="modal" data-target="#full-flyer-120" href="#">CLICK ME</a>

<div class="modal fade" id="full-flyer-120" tabindex="-1" role="dialog" aria-labelledby="full-flyer-120Label" style="display: none;">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<img class="img-responsive" src="http://portalwiedzy.onet.pl/_i/mendelejew.jpg" alt="Full mendelejew">
</div>
</div>
</div>
</div>

基本上,您需要稍微更改图像样式。

希望对你有帮助

关于css - 模态窗口中的图像 - 如何将模态宽度设置为自动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35275241/

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