Currently working on my own customized modal, here's the unique CSS I came up with:
.custom-modal{
position: absolute;
display: block;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #000;
filter:alpha(opacity=50);
-moz-opacity:0.5;
-khtml-opacity: 0.5;
opacity: 0.5;
z-index: 999;
.custom-modal-content{
margin: 60px auto;
background-image:url('/static/img/background-modal.jpg');
width: 700px;
height: 700px;
.box-shadow(0 10px 2px #999);
}
}
Let's take a look at the corresponding HTML structure:
<div class="custom-modal">
<div class="custom-modal-content">
My Unique Modal
</div>
</div>
The purpose of .custom-modal is to create a greyed-out background while .custom-modal-content represents the actual modal box that pops up.
An issue arises when the greyed out background only covers the browser window and not the entire content of the modal box. If I use a fixed position for the background, it may obstruct the full view of .model-content.