如何设置角度模态自定义高度和宽度

时间:2014-10-04 22:38:39

标签: angularjs angular-ui-bootstrap

我找到了一种改变角度模态宽度的方法,但我怎么也想不出如何设置我想要的高度。我需要模态宽度为400px,高度为400px。我还需要重新定位它,使它位于屏幕的中心。谢谢 plunkr

 $scope.NewJobModal = function () {

      var modalInstance = $modal.open({
          templateUrl: 'views/modals/NewJobModal.html',
          controller: 'NewJobModalInstanceCtrl',
          windowClass: 'large-Modal',
          resolve: {
              p: function () {
                  return $scope.p;
              }
          }
      });
  };

.large-Modal .modal-dialog{
width:30%;
}

1 个答案:

答案 0 :(得分:10)

两件事:

1 - 在Plunkr中,您提供的不是附加.css文件。将src更改为href。

2 - 然后在你的css文件中:

.large-Modal .modal-dialog{
  height: 400px;
  width:400px; 
  margin: auto;
  position: absolute;
  top:0;
  right: 0;
  bottom: 0;
  left: 0;
}