防止在实体化中隐藏滚动条中的模态

问题描述 投票:0回答:1

[每当我从Materializecss打开一个模态时,滚动条(我的身体都有内联滚动条)每次都会隐藏。我应该怎么做,以便每当我打开一个模态时,主体的滚动条都将保留?

<body>
        <div id="modal_confirm_block" class="modal modal_dialog">
            <div class="modal-content white" id="modal_confirm_co_content" style="padding:0px !important;">
                <div id="div_available" class="center-align" style="padding: 20px !important;"> <i class="material-icons md-12 noselect center-align amber-text darken-4" > warning</i><br>
                    <p style="padding:20px !important;" class="center-align"> Are you sure you want to block this guest? </p>
                </div>
            </div>
            <div class="modal-footer">
                <div class="row" style="margin: 0 !important;">
                    <div class="col s6"> <a href="#!" id="btn_confirm_block" class=" cyan darken-2 white-text modal-action waves-effect waves-white btn" style="width:100% !important;">Confirm</a></div>
                    <div class="col s6">    <a href="#!" id="btn_cancel_block" class="blue-grey darken-4 white-text  modal-action modal-close waves-effect waves-white btn" style="width:100% !important; ">Cancel</a></div>
                </div>
            </div>
        </div>
    </body>

Screenshot before opening a modalScreenshot when a modal opens. Look at the scrollbar it was removed. And I don't like that because the screen always move.

html css materialize
1个回答
0
投票

对我来说,它是通过这样的方式将其放入CSS中的。

正文{溢出:滚动!重要}

© www.soinside.com 2019 - 2024. All rights reserved.