Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Center the loading .gif in the middle of the screen? Re: Center the loading .gif in the middle of the screen?

#126683
DADE
Participant

I know it’s marked as solved but small tip:

margin: 0 auto;

Will only center your image horizontally. What would I do is:

// Lets say your loading.gif is 100px by 100px
.white-screen {
position: relative;
}

.loading-gif {
position: absolute;
top: 50%;
left: 50%;
margin: -50px 0px 0px -50px;
}

This will center it horizontally and vertically. Margin should be twice less that your image size, so if your image is 100x50px, margin should be -50px 0px 0px -25px.