Answers for "position modal in middle"

CSS
2

how to make a modal stay center of screen

//add a  onclick function to your modal button
<button type="button" class="header__button" data-toggle="modal" data-target="#signUpModal" onclick="modalCenter()">
	signup
</button>
//add below function to your scripts
function modalCenter() {
        $('#signUpModal').css({
            'display': 'flex',
            'justify-content': 'center',
            'align-items': 'center'
        })
    }
Posted by: Guest on January-06-2021
0

css center modal vertically

.yourElement{
  position: relative;
  top: 50%;
  transform: translateY(-50%);
}
Posted by: Guest on April-05-2021

Browse Popular Code Answers by Language