关于bootstrap设置modal的宽度,并水平居中显示(class="bs-example-modal-lg"和class="modal-lg"宽度依然不够用时)
<div class="modal fade bs-example-modal-lg" id="showProvinceResult" tabindex="-1" role="dialog" aria-labelledby="showApprovalLabel" aria-hidden="true"> <div class="modal-dialog modal-lg" role="document"> <div class="modal-content" style="width: 950px;">
先添加样式属性设置宽度,注意是在 class="modal-content" 行内添加,加在其他地方均无效(网上有说加在class="modal-dialog",亲测无效)。
<div class="modal-content" style="width: 950px;">
加完width后modal宽度会调整,但不会水平居中显示,然后在继续添加 class="bs-example-modal-lg"和class="modal-lg"
<div class="modal fade bs-example-modal-lg" id="showProvinceResult" tabindex="-1" role="dialog" aria-labelledby="showApprovalLabel" aria-hidden="true"> <div class="modal-dialog modal-lg" role="document">
这样就可以实现modal宽度改变并居中显示。