IamNOOB IamNOOB - 15 days ago 5
CSS Question

Aligning preloader to center

I want to align the preloader with class

preloader-align
to center of the
tab-containts
, But the problem is when i make
left: 50%
nothing happens. Changes happen after increasing the percentage to
500%
But it does not make it responsive.

Here is the code:

http://codepen.io/anon/pen/ZBLzBe

.preloader-align{
position:absolute;
top: 50%;
left: 50% ;
width: 100px;
height: 100px;

}
.tab-containts{
min-height: 500px;
position: absolute;
}

Answer

Also add to .preloader-align:

margin-left: -50px; margin-top: -50px;

or use:

transform: translate(-50%, -50%);

To center it perfectly.

Comments