gpt4 book ai didi

ruby-on-rails - 模态 Bootstrap ,图像而不是按钮

转载 作者:行者123 更新时间:2023-12-03 12:26:41 24 4
gpt4 key购买 nike

我尝试使用 Bootstrap 中的模式,但我想使用图像而不是按钮。但我根本不知道该怎么做。以及在哪里插入

data-toggle="modal" data-target="#myModal

http://getbootstrap.com/javascript/#modals

Bootstrap 模态
<!-- Button trigger modal -->
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Launch demo modal
</button>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->

最佳答案

您可以将图像放在这样的链接中...

<a data-toggle="modal" data-target="#myModal">
<img src="//placehold.it/100x30">
</a>

演示: http://bootply.com/98748

关于ruby-on-rails - 模态 Bootstrap ,图像而不是按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20400223/

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