Cannot keep footer at bottom in bootstrap modal fullscreen

13,045

You can give the model-content a relative position and modal-footer position absolute with bottom 0px;

Try with

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

.modal-footer {
  border-radius: 0;
  bottom:0px;
  position:absolute;
  width:100%;
}

fiddle :http://jsfiddle.net/1fh2n5y3/

Share:
13,045

Related videos on Youtube

AgainMe
Author by

AgainMe

Updated on May 15, 2022

Comments

  • AgainMe
    AgainMe 13 days

    I'm trying to keep the footer of bootstrap modal to bottom but I can't, this is my html structure:

    <!-- Button trigger modal -->
    <button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
      Launch demo modal
    </button>
    
    <!-- Modal -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title" id="myModalLabel">Modal title</h4>
          </div>
          <div class="modal-body">
            ...
          </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>
    

    Essentially I want display the modal at fullscreen mode, this working good, but the footer doesn't go to bottom.

    Css:

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

    I create a jsfiddle that explain the situation:

    http://jsfiddle.net/8XdVt/?utm_source=website&utm_medium=embed&utm_campaign=8XdVt

    and

    http://jsfiddle.net/8XdVt/show/

  • AgainMe
    AgainMe over 5 years
    working on desktop not on mobile, cause a strange effect could you try on smartphone?
  • Deep
    Deep over 5 years
    looks fine on chrome browser on my nexxus device , on which phone are you checking ?
  • Deep
    Deep over 5 years
    i am also on Nexus 5 and it looks fine, could you share a screenshot ?
  • AgainMe
    AgainMe over 5 years
    Got this working, I miss a tag, thanks. PS: good phone choice :P
  • Baezid Mostafa
    Baezid Mostafa over 5 years
    @AgainMe I don't find any problem it's working on my side.