1

I tried to create a modal window having full height even if the content is small. I set css min-height:100% to .modal-dialog and tried various other options. But min-height is not working for modal window.

My requirement is:

Even if content is small modal window should be full screen

If content is huge modal window should have a scroll bar and should include all content.

amphetamachine
  • 27,620
  • 12
  • 60
  • 72

2 Answers2

2

You can use height 100% only if the object is inside an element with known height. If the parent have no height, the browser has nothing to reference.

Solution in pure CSS:

.my-div {
position:fixed !important;
position:absolute;
top:0;
right:0;
bottom:0;
left:0;
}

You can set in jquery function where you open the dialog:

$('.my-div').css('height', window.innerHeight);
Gringo Suave
  • 29,931
  • 6
  • 88
  • 75
Germano Plebani
  • 3,461
  • 3
  • 26
  • 38
0

Try this

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

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

How to make Twitter bootstrap modal full screen

Community
  • 1
  • 1