twitter-bootstrap - Bootstrap 4模式弹出标题登录在单击时向右拉伸(stretch)

标签 twitter-bootstrap modal-dialog bootstrap-4 bootstrap-modal

单击时,我的 bootstrap 4 登录会在标题上弹出,一直向右延伸。

My header

The header when I clicked the login pop up

这是我的链接代码:

   <li class="nav-item">
        <a class="nav-link btn btn-outline-info px-4 mt-1" data-toggle="modal" data-target="#loginModal1">Login</a>
        </li>

这是我的模式代码:

<div class="modal fade" role="dialog" id="loginModal1">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <h3 class="modal-title">Modal Login Form</h3>
                        <button type="button" class="close" data-dismiss="modal">&times;</button>
                    </div>
                    <div class="modal-body">
                        <div class="form-group">
                            <input type="text" name="" class="form-control" placeholder="Username">
                        </div>

                        <div class="form-group">
                            <input type="password" name="" class="form-control" placeholder="Password">
                        </div>
                    </div>

                    <div class="modal-footer">
                        <button type="submit" class="btn btn-warning">Sign in</button>
                    </div>
                </div>
            </div>
        </div>

最佳答案

通过将其添加到我的 scss 代码中来修复它..

 .modal-open {
    overflow-y: auto !important;
    padding-right: 0 !important;
    }

  .modal-scrollbar-measure {  
    overflow: hidden;
    }

关于twitter-bootstrap - Bootstrap 4模式弹出标题登录在单击时向右拉伸(stretch),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51580279/

相关文章:

html - Bootstrap 类 ="h-100"在 Firefox 中工作但在 Chrome 中不工作

html - 折叠的 Bootstrap 导航栏不起作用

c# - 将值从一种形式发送到另一种形式

html - 在 Bootstrap 中使轮播图像适合移动设备

javascript - 是否可以通过使用javascript获取数组中的一项来删除一项?

javascript - 如果在模态对话框外进行单击,如何禁用用户所做的所有单击

html - 将背景颜色应用于具有背景图像的容器

javascript - 如何在 bootstrap 4 中使模态响应

javascript - 在 Bootstrap 表中实现列卡住

javascript - 自举网格间距不正确