Bootstrap modal appearing under background

前端 未结 30 1288
离开以前
离开以前 2020-11-22 17:09

I have used the code for my modal straight from the Bootstrap example, and have included only the bootstrap.js (and not bootstrap-modal.js). However, my modal is appearing u

30条回答
  •  无人及你
    2020-11-22 17:37

    I have a lighter and better solution..

    It could be easily solve through some additional CSS styles..

    1. hide the class .modal-backdrop (auto generated from Bootstrap.js)

      .modal-backdrop
      {
      display:none;
      visibility:hidden; 
      position:relative
      }
      
    2. set the background of .modal to a translucent black backdrop image.

      .modal
      {
      background:url("http://bin.smwcentral.net/u/11361/BlackTransparentBackground.png")
      // translucent image from google images 
      z-index:1100; 
      }
      

    This will works best if you have a requirement that needs the modal to be inside an element and not near the tag..

提交回复
热议问题