Upon loading the page, my spinner appears in the center of the screen after a second. However, in the initial frame of the page, it is not centered but positioned on the top-left corner instead. How can I ensure that my spinner starts off centered from the beginning? Centering the loader itself is not an issue for me, I just want the spinner to begin in the middle of the page. I have searched for similar problems but none seem to match mine precisely. Below is the CSS code I am using:
.loader {
/*left: 50%;
position: fixed;
top: 50%;
transform: translate3d(-50%, -50%, 0);
z-index: 999;*/
position: fixed;
z-index: 999;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
html:
<div class="loader">
<img src="../../../../assets/content/Amsa-loading.gif">
</div>