OK I was able to get my modal as desired using the following CSS, using !important
as a safeguard to ensure they aren’t overridden by the ionic2 modal (inset) css depending on whether it’s a smaller or larger device:
.modal-wrapper{
position:absolute !important;
width:90vw !important;
height:260px !important;
top:0 !important;
bottom: 0 !important;
left: 0 !important;
right: 0 !important;
margin: auto !important;
}
.modal .backdrop{
display:block !important;
}
The height is the height of my particular div to ensure there is no excess space. The top
, bottom
, left
, right
and margin auto
settings ensure it’s centered on the page. The width=90vw
ensures 5 viewport-widths of margin either side and thus responsive for different devices.