I'm struggling to center the text both vertically and horizontally inside my div. No matter what I try, I can only get it to align horizontally. Here is the CSS code I have been using:
#loading > h1 {
text-align: center;
font-size: 21px;
animation: fadeUpIn 3s;
-webkit-animation: fadeUpIn 3s; /* Safari and Chrome */
}
@-webkit-keyframes fadeUpIn /* Safari and Chrome */
{
from { opacity:0; top:150px; }
to { opacity:1; top: 70px; }
}
#loading{
position: absolute; top: 0; left: 0;
width:100%;
height: 100%;
background-color: gray;
color: white;
opacity: 1;
transition: 1s;
visibility: visible;
}
#loading.hidden{
opacity: 0;
visibility: hidden;
}
This is a snippet of my HTML code:
<div id="loading">
<h1>Creative. Simple.</h1>
</div>
For a full view of my website, you can visit this JS Fiddle link: https://jsfiddle.net/sjyoqdqy/