You want to edit .modal-dialog and force the dimensions.

Example CSS:

.modal-dialog {
    max-width: 100%;
    margin: 0;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100vh;
    display: flex;
}

Additionally to get this working in vue. You can try adding a class to b-modal and trying something like this:

<div>
  <b-button v-b-modal.modal1>Launch demo modal</b-button>

  <!-- Modal Component -->
  <b-modal class="test-modal" id="modal1" title="BootstrapVue">
    <p class="my-4">Hello from modal!</p>
  </b-modal>
</div>

CSS:

.test-modal .modal-dialog {
    max-width: 100%;
    margin: 0;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100vh;
    display: flex;
    position: fixed;
    z-index: 100000;
}
Answer from brooksrelyt on Stack Overflow
🌐
GitHub
github.com › basilebong › bootstrap4-fullscreen-modal
GitHub - basilebong/bootstrap4-fullscreen-modal: An easy solution to create a bootstrap 4 fullscreen modal
<!-- Button trigger modal --> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal"> Launch fullscreen modal </button> <!-- Modal --> <div class="modal fade modal-fullscreen" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Modal title</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> </div> <div class="modal-body"> This is a fullscreen modal </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> </div> </div> </div> </div>
Starred by 9 users
Forked by 4 users
Languages   JavaScript 100.0% | JavaScript 100.0%
🌐
Bootstrap
getbootstrap.com › docs › 4.6 › components › modal
Modal · Bootstrap v4.6
Bootstrap 4 has reached end of life. Upgrade to the latest or consider Never-Ending Support for your project. ... Use Bootstrap’s JavaScript modal plugin to add dialogs to your site for lightboxes, user notifications, or completely custom content.
🌐
jQuery Script
jqueryscript.net › jquery plugins › jquery lightbox plugins
Full Screen Modal Dialog In Bootstrap 4 | Free jQuery Plugins
A CSS extension to Bootstrap 4 framework that makes the modal component take up the whole screen when toggled. 1. Load the stylesheet bootstrap4-modal-fullscreen.css in your Bootstrap project.
🌐
Bootstrap
getbootstrap.com › docs › 5.0 › components › modal
Modal · Bootstrap v5.0
<!-- Full screen modal --> <div class="modal-dialog modal-fullscreen-sm-down"> ...
🌐
CodePen
codepen.io › andreivictor › pen › MWYNPBV
Bootstrap 4 Modal Fullscreen
Spaces · Tabs · 1 · 2 · 3 · 4 · 5 · 6 · Visit your global Editor Settings. HTML CSS JS Result · HTML Options · Format HTML · View Compiled HTML · Analyze HTML · Maximize HTML Editor · Minimize HTML Editor · Fold All · Unfold All · <!-- Buttons --> <button class="btn btn-primary btn-lg btn-open-modal" data-toggle="modal" data-target="#modal-fullscreen-xs"> Fullscreen modal xs down </button> <button class="btn btn-primary btn-lg btn-open-modal" data-toggle="modal" data-target="#modal-fullscreen-sm"> Fullscreen modal sm down </button> <button class="btn btn-primary btn-lg btn-ope
Top answer
1 of 14
328

I achieved this in Bootstrap 3 with the following code:

.modal-dialog {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.modal-content {
  height: auto;
  min-height: 100%;
  border-radius: 0;
}

In general, when you have questions about spacing / padding issues, try right+clicking (or cmd+clicking on mac) the element and select "inspect element" on Chrome or "inspect element with firebug" on Firefox. Try selecting different HTML elements in the "elements" panel and editing the CSS on the right in real-time until you get the padding / spacing you want.

Here is a live demo

Here is a link to the fiddle

2 of 14
85

I've came up with a "responsive" solution for fullscreen modals:

Fullscreen Modals that can be enabled only on certain breakpoints. In this way the modal will display "normal" on wider (desktop) screens and fullscreen on smaller (tablet or mobile) screens, giving it the feeling of a native app.

Implemented for Bootstrap 3 and Bootstrap 4. Included by default in Bootstrap 5.


Bootstrap v5

Fullscreen modals are included by default in Bootstrap 5: https://getbootstrap.com/docs/5.0/components/modal/#fullscreen-modal


Bootstrap v4

The following generic code should work:

.modal {
  padding: 0 !important; // override inline padding-right added from js
}
.modal .modal-dialog {
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
}
.modal .modal-content {
  height: 100%;
  border: 0;
  border-radius: 0;
}
.modal .modal-body {
  overflow-y: auto;
}

By including the scss code below, it generates the following classes that need to be added to the .modal element:

+---------------------+---------+---------+---------+---------+---------+
|                     |   xs    |   sm    |   md    |   lg    |   xl    | 
|                     | <576px  | ≥576px  | ≥768px  | ≥992px  | ≥1200px |
+---------------------+---------+---------+---------+---------+---------+
|.modal-fullscreen    |  100%   | default | default | default | default | 
+---------------------+---------+---------+---------+---------+---------+
|.modal-fullscreen-sm |  100%   |  100%   | default | default | default | 
+---------------------+---------+---------+---------+---------+---------+
|.modal-fullscreen-md |  100%   |  100%   |  100%   | default | default |
+---------------------+---------+---------+---------+---------+---------+
|.modal-fullscreen-lg |  100%   |  100%   |  100%   |  100%   | default |
+---------------------+---------+---------+---------+---------+---------+
|.modal-fullscreen-xl |  100%   |  100%   |  100%   |  100%   |  100%   |
+---------------------+---------+---------+---------+---------+---------+

The scss code is:

@mixin modal-fullscreen() {
  padding: 0 !important; // override inline padding-right added from js

  .modal-dialog {
    width: 100%;
    max-width: none;
    height: 100%;
    margin: 0;
  }

  .modal-content {
    height: 100%;
    border: 0;
    border-radius: 0;
  }

  .modal-body {
    overflow-y: auto;
  }

}

@each $breakpoint in map-keys($grid-breakpoints) {
  @include media-breakpoint-down($breakpoint) {
    $infix: breakpoint-infix($breakpoint, $grid-breakpoints);

    .modal-fullscreen#{$infix} {
      @include modal-fullscreen();
    }
  }
}

Demo on Codepen: https://codepen.io/andreivictor/full/MWYNPBV/


Bootstrap v3

Based on previous responses to this topic (@Chris J, @kkarli), the following generic code should work:

.modal {
  padding: 0 !important; // override inline padding-right added from js
}

.modal .modal-dialog {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.modal .modal-content {
  height: auto;
  min-height: 100%;
  border: 0 none;
  border-radius: 0;
  box-shadow: none;
}

If you want to use responsive fullscreen modals, use the following classes that need to be added to .modal element:

  • .modal-fullscreen-md-down - the modal is fullscreen for screens smaller than 1200px.
  • .modal-fullscreen-sm-down - the modal is fullscreen for screens smaller than 922px.
  • .modal-fullscreen-xs-down - the modal is fullscreen for screen smaller than 768px.

Take a look at the following code:

/* Extra small devices (less than 768px) */
@media (max-width: 767px) {
  .modal-fullscreen-xs-down {
    padding: 0 !important;
  }
  .modal-fullscreen-xs-down .modal-dialog {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
  }
  .modal-fullscreen-xs-down .modal-content {
    height: auto;
    min-height: 100%;
    border: 0 none;
    border-radius: 0;
    box-shadow: none;
  } 
}

/* Small devices (less than 992px) */
@media (max-width: 991px) {
  .modal-fullscreen-sm-down {
    padding: 0 !important;
  }
  .modal-fullscreen-sm-down .modal-dialog {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
  }
  .modal-fullscreen-sm-down .modal-content {
    height: auto;
    min-height: 100%;
    border: 0 none;
    border-radius: 0;
    box-shadow: none;
  }
}

/* Medium devices (less than 1200px) */
@media (max-width: 1199px) {
  .modal-fullscreen-md-down {
    padding: 0 !important;
  }
  .modal-fullscreen-md-down .modal-dialog {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
  }
  .modal-fullscreen-md-down .modal-content {
    height: auto;
    min-height: 100%;
    border: 0 none;
    border-radius: 0;
    box-shadow: none;
  }
}

Demo is available on Codepen: https://codepen.io/andreivictor/full/KXNdoO.

Those who use Sass as a preprocessor can take advantage of the following mixin:

@mixin modal-fullscreen() {
  padding: 0 !important; // override inline padding-right added from js

  .modal-dialog {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
  }

  .modal-content {
    height: auto;
    min-height: 100%;
    border: 0 none;
    border-radius: 0;
    box-shadow: none;
  }

}
🌐
npm
npmjs.com › package › bootstrap4-fullscreen-modal
bootstrap4-fullscreen-modal - npm
<!-- Button trigger modal --> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal"> Launch fullscreen modal </button> <!-- Modal --> <div class="modal fade modal-fullscreen" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Modal title</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> </div> <div class="modal-body"> This is a fullscreen modal </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> </div> </div> </div> </div>
      » npm install bootstrap4-fullscreen-modal
    
Published   Oct 27, 2020
Version   4.5.0
Author   Basile Bong
Find elsewhere
🌐
Codeply
codeply.com › go › rNFv5RJJqn › bootstrap-4-modal-full-screen
Bootstrap 4 Full Screen Modal on Codeply
HTML, CSS, JavaScript editor playground for designers & developers to compare, prototype and test frontend frameworks
🌐
CodePen
codepen.io › nathancooper › pen › YzoZxq
Fullscreen Bootstrap Modal
4 · 5 · 6 · Visit your global Editor Settings. HTML CSS JS Result · HTML Options · Format HTML · View Compiled HTML · Analyze HTML · Maximize HTML Editor · Minimize HTML Editor · Fold All · Unfold All · <!-- view modal --> <button class="btn btn-primary btn-modal" data-toggle="modal" data-target="#fsModal"> View Fullscreen Modal </button> <!-- view modal --> <!-- modal --> <div id="fsModal" class="modal animated bounceIn" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <!-- dialog --> <div class="modal-dialog"> <!-- content --> <div class="modal-content"> <!-- header --> <div class="modal-header"> <h1 id="myModalLabel" class="modal-title"> Modal title </h1> </div> <!-- header --> <!-- body --> <div class="modal-body"> <h2>1.
🌐
GitHub
github.com › keaukraine › bootstrap4-fs-modal
GitHub - keaukraine/bootstrap4-fs-modal: A simple way to improve UX of Bootstrap 4 modals on mobile phones.
A simple, CSS-only solution to improve UX of Bootstrap 4 modals on mobile phones. Regular Bootstrap modals (with a lot of content) on mobile devices can cause additional vertical scrolling in order to get to the header and footer of modal. Fullscreen modal provides more native user experience on mobile phones, with responsive behavior similar to modals in ZURB Foundation.
Starred by 107 users
Forked by 10 users
Languages   HTML 78.9% | CSS 18.5% | JavaScript 2.6% | HTML 78.9% | CSS 18.5% | JavaScript 2.6%
🌐
W3Schools
w3schools.com › bootstrap5 › tryit.asp
Fullscreen Modal Example
The W3Schools online code editor allows you to edit code and view the result in your browser
🌐
GitHub
github.com › benallfree › bootstrap-fullscreen-modal
GitHub - benallfree/bootstrap-fullscreen-modal
<div class="modal fade modal-fullscreen" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title" id="myModalLabel">Modal title</h4> </div> <div class="modal-body"> Some great content </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary">Save changes</button> </div> </div> </div> </div> For special cases, you may need to enable full screen viewing programatically.
Starred by 6 users
Forked by 6 users
Languages   JavaScript 100.0% | JavaScript 100.0%
🌐
npm
npmjs.com › package › bootstrap-modal-fullscreen
bootstrap-modal-fullscreen - npm
<div class="modal fade modal-fullscreen" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title" id="myModalLabel">Modal title</h4> </div> <div class="modal-body"> Some great content </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary">Save changes</button> </div> </div> </div> </div> For special cases, you may need to enable full screen viewing programatically.
      » npm install bootstrap-modal-fullscreen
    
Published   Aug 14, 2017
Version   1.1.1
Author   Ben Allfree
🌐
W3Schools
w3schools.com › bootstrap4 › bootstrap_modal.asp
Bootstrap 4 Modals
<!-- Button to Open the Modal --> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal"> Open modal </button> <!-- The Modal --> <div class="modal" id="myModal"> <div class="modal-dialog"> <div class="modal-content"> <!-- Modal Header --> <div class="modal-header"> <h4 class="modal-title">Modal Heading</h4> <button type="button" class="close" data-dismiss="modal">&times;</button> </div> <!-- Modal body --> <div class="modal-body"> Modal body..
🌐
Bootstrap
getbootstrap.com › docs › 4.2 › components › modal
Modal · Bootstrap
Clicking on the modal “backdrop” will automatically close the modal. Bootstrap only supports one modal window at a time.
🌐
MDBootstrap
mdbootstrap.com › standard › full screen modal
Bootstrap Full screen modal - free examples & tutorial
If you want your modal to appear in full screen, just add the .modal-fullscreen class next to .modal-dialog. ... <!-- Button trigger modal --> <button type="button" data-mdb-button-init data-mdb-ripple-init class="btn btn-primary" ...
🌐
Blocs Forum
forum.blocsapp.com › i need help
How can I make the modal Fullscreen? SOLVED - I Need Help - Blocs Forum
October 17, 2020 - Hi, I try to make a modal fullscreen. I watched Eldar’s tutorial, but whatever I do there is always a small edge left, right, top and bottom shining through, even when adjusting the modal-content class. Plus, even with h…
🌐
Noreiller
noreiller.github.io › bootstrap-modal-carousel › modal-fullscreen.html
Bootstrap modal carousel : modal-fullscreen
Maximize a modal box on the screen. The default one from Twitter Bootstrap See it in action ... Based on the default Twitter Bootstrap code of the modal component, add the class name .modal-fullscreen to the modal element to display it in fullscreen and that's it.