Achieve IE8 vertical centering when the absolute element is highly uncertain?

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?

Css
Aug.12,2021

absolute maybe not. Try table

<div class="modal">
  <div class="modal-container">
      <div class="modal-main">
        <span>
          x<br/>
          x<br/>
          x<br/>
          x<br/>
          x<br/>
        </span>
      </div>
  </div>
</div>

.modal{
  position:fixed;
  top:0;
  bottom:0;
  left:0;
  right:0;
  background:rgba(0,0,0,.5);
}
.modal-container{
  width: 100%;
  height: 100%;
  display:table;
}
.modal-main{
  display: table-cell;
  vertical-align: middle;
  text-align: center;
}
.modal-main span{
  display: inline-block;
  width: 150px;
  background-color: -sharpfff;
}

refer to horizontal and vertical center

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b40c97-4dbdc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b40c97-4dbdc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?