• 技术文章 >web前端 >Bootstrap教程

    bootstrap模态框加滚动条

    藏色散人藏色散人2020-11-25 18:10:29原创510

    bootstrap模态框加滚动条的方法:首先打开相应的代码文件;然后通过设置属性为“.modal-content {overflow: auto;max-height:300px;}”即可。

    推荐:《bootstrap基础教程

    Bootstrap模态框添加滚动条(一级)

    代码如下:

    /*不使用页面的滚动条*/
    /*css:
    给模态框设置overflow-y: hidden;即为取消掉页面滚动条的使用*/
    #HelpModal{margin-top: 95px;height: 300px;overflow-y: hidden;}
    /*添加滚动条*/
    .modal-content {overflow: auto;max-height:300px;}
    /*html:模态框最外层设置id属性的overflow-y: hidden;,权重值高于自定义的.modal-open .modal类名设置的overflow-y: auto;*/
    <div class="modal fade" id="HelpModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

    以上就是bootstrap模态框加滚动条的详细内容,更多请关注php中文网其它相关文章!

    声明:本文原创发布php中文网,转载请注明出处,感谢您的尊重!如有疑问,请联系admin@php.cn处理
    专题推荐:bootstrap
    上一篇:bootstraptable 隐藏列的方法 下一篇:Bootstrap框架有哪些缺点?
    大前端线上培训班

    相关文章推荐

    • 如何去掉bootstrap模态框的遮罩层• bootstrap icon不显示怎么办• 关于bootstrap model隐藏问题• bootstrap的组件有哪些?

    全部评论我要评论

  • 取消发布评论发送
  • 1/1

    PHP中文网