여기 에서 가져온 해결책을 따랐 지만 작동하지 않습니다. 모달을 화면 중앙에 수평 및 수직으로 중앙에 배치해야합니다. 이 플렁크 에서 시도했지만 작동하지 않습니다. 아이디어가 있습니까?
자바 스크립트
var app = angular.module('app', ['ui.bootstrap']);
app.controller('ctl', function ($scope,$uibModal) {
$scope.modalInstance = $uibModal.open({
templateUrl: 'myModalContent.html',
windowClass: 'app-modal',
});
});
HTML
<style>
.app-modal .modal-content {
width: 360px;
height: 200px;
}
</style>
<script type="text/ng-template" id="myModalContent.html">
<div class="modal-header">
<h4 class="modal-title">The Title</h4>
</div>
<p>Some text</p
</script>
CSS에서 다음을 시도하십시오.
.modal-dialog {
position: absolute;
top: 50%;
/*half of the modal height*/
margin-top: -100px;
left: 50%;
/*half of the modal width*/
margin-left: -180px;
}
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다