为什么bootstrap 5. 0模态框不工作也不出现
Why bootstrap 5. 0 Modal doesn't work nor appear
你能帮我修复模态吗,我正在为我的 bootstrap 模态使用锚标记,但它不起作用。
似乎是什么问题?
'''
<div class="p border-top py-3">Doesn't have an account yet? <a href="#" data-toggle="modal" data-target="#exampleModalCenter">Create an account</a></div>
<div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
...
</div>
</div>
</div>
'''
改成data-bs-toggle就可以了,data-bs-target
<div class="p border-top py-3">Doesn't have an account yet? <a href="#" data-bs-toggle="modal" data-bs-target="#exampleModalCenter">Create an account</a></div>
<div class="modal fade" id="exampleModalCenter" tabindex="-1" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
..
</div>
</div>
</div>
你能帮我修复模态吗,我正在为我的 bootstrap 模态使用锚标记,但它不起作用。 似乎是什么问题? '''
<div class="p border-top py-3">Doesn't have an account yet? <a href="#" data-toggle="modal" data-target="#exampleModalCenter">Create an account</a></div>
<div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
...
</div>
</div>
</div>
'''
改成data-bs-toggle就可以了,data-bs-target
<div class="p border-top py-3">Doesn't have an account yet? <a href="#" data-bs-toggle="modal" data-bs-target="#exampleModalCenter">Create an account</a></div>
<div class="modal fade" id="exampleModalCenter" tabindex="-1" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
..
</div>
</div>
</div>