I have found a way to change the width of a angular modal, how ever I can not figure out how to set the height I want. I need the modal to be 400px width, 400px height. also I need to reposition it so it is in the center of the screen. thanks 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%;
}
Change the size of the modal by adding the . modal-sm class for small modals, . modal-lg class for large modals, or . modal-xl for extra large modals.
In order to increase or decrease the modal window height and width properties of Bootstrap, you need to get the modal related classes and use desired values either in the <style> section or in your external CSS file.
To achieve greater sizes than this, you have to use a stylesheet imported and on the Modal component itself, specifically a property called contentClassName . By writing to a separate file like styles. css and importing it, it will use those styles if the class name is put in contentClassName .
Answer: Set width for . modal-dialog element However, if you still want to customize the size of the modal window you can override the CSS width property of the . modal-dialog class to resize the default modal. Similarly, you can override the width property of . modal-sm , .
Two things:
1 - In the Plunkr you provided you're not attaching you .css file. Change the src to href.
2 - Then in your css file:
.large-Modal .modal-dialog{
height: 400px;
width:400px;
margin: auto;
position: absolute;
top:0;
right: 0;
bottom: 0;
left: 0;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With