I am struggling to vertically center my text on a page. Whenever I click a button, the page becomes gray with a loading message. Although I've managed to horizontally center it, vertical alignment is posing a challenge.
CSS
.LockOff {
display: none;
visibility: hidden;
}
.LockOn {
display: block;
visibility: visible;
position: absolute;
z-index: 999;
bottom: 0px;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
background-color: #ccc;
text-align: center;
padding-top: 20%;
filter: alpha(opacity=75);
opacity: 0.75;
}
.lockMsg {
color:black;
font-weight: bold;
}
HTML
<script type="text/javascript">
function lockScreen() {
var lock = document.getElementById('divLock');
if (lock)
lock.className = 'LockOn';
lock.innerHTML = "<h1 class=\"lockMsg\">YOUR REQUEST IS BEING PROCESSED. PLEASE WAIT.</h1>";
}
</script>
<div id="divLock" class="LockOff"></div>