demo: http://jsfiddle.net/os1tuage/
<div class="modal">
<div class="modal-main">
x<br/>
x<br/>
x<br/>
x<br/>
x<br/>
</div>
</div>
.modal{
position:fixed;
top:0;
bottom:0;
left:0;
right:0;
background:rgba(0,0,0,.5)
}
.modal-main{
position:absolute;
width:150px;
top:50%;
left:50%;
transform:translate(-50%,-50%);
background:-sharpfff;
text-align:center;
}
my requirement is for the absolute element to center IE8 vertically with a high degree of uncertainty, using translate to achieve the effect, but IE8,IE9 cannot be used? Is there any good way to achieve it?