【问题标题】:Can I use an image to trigger a modal window in Bootstrap?我可以使用图像在 Bootstrap 中触发模态窗口吗?
【发布时间】:2013-03-03 15:27:01
【问题描述】:

真的很简单的问题。我需要使用图像,而不是让按钮触发模式窗口。我无法弄清楚执行此操作的代码。有什么建议吗?

【问题讨论】:

标签: image twitter-bootstrap modal-window


【解决方案1】:

是的,您只需将标签包裹在图像周围。

<a href="#myModal" role="button" data-toggle="modal">

<img src="http://placehold.it/150x150"></a>

这是一个活生生的例子:

Bootstrap modal trigger by an image

【讨论】:

    猜你喜欢
    • 2014-02-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-06
    • 2015-12-06
    • 1970-01-01
    • 2017-06-26
    相关资源
    最近更新 更多