I am working on creating simple modal divs:
<div class="modal"></div>
<div class="modal-content"></div>
Here are the related CSS rules:
.modal{position:fixed;background:#444;opacity:0.5;width:100%;height:100%;left:0;right:0;bottom:0;top:0;}
.modal-content{position:fixed;background:#fff;width:auto;height:auto;top:25%;left:25%;right:25%;}
My goal is to keep .modal-content centered on the page with a maximum width of 500px, while maintaining its current auto width.
Can this be achieved without using JavaScript?