Centralizing modal bootstrap

0

I have modal bootstrap on my page HTML . When I open the modal in the computer browser, the modal appears as follows:

ButwhenIsimulatethescreenofasmartphone,themodalbehindmymenunav:

Belowisthemodalcode:

<divid="modal-facens" class="modal fade" role="dialog">
    <div class="modal-dialog">
      <!-- Modal content-->
      <div class="modal-content">
        <div class="modal-header">
          <h4 class="modal-title">FACENS - Faculdade de Engenharia de Sorocaba</h4>
          <i class="fa fa-map-marker" aria-hidden="true"></i> Sorocaba/SP <br>
          <a href="http://www.facens.br/" target="_blank">http://www.facens.br/</a>
        </div>
        <div class="modal-body">
            <p>
                Cursando o último ano de Engenharia da Computação 
            </p>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn-info btn-sm" data-dismiss="modal">Fechar</button>
        </div>
      </div>
    </div>
</div>

I would like the modal to be centralized in any situation (computer or mobile). How can I do it ?

    
asked by anonymous 07.02.2017 / 19:42

1 answer

2

Resolved.

I've changed the CSS code with the content below:

.modal {
  text-align: center;
  padding: 0!important;
}

.modal:before {
  content: '';
  display: inline-block;
  height: 100%;
  vertical-align: middle;
  margin-right: -4px;
}

.modal-dialog {
  display: inline-block;
  text-align: left;
  vertical-align: middle;
}

The result I wanted:

    
08.02.2017 / 17:04