0

I have the below HTML to show a loader with some content below loader image:

.LoaderText {
    position: fixed;
    height: 0;
    width: 0;
    display: flex;
    justify-content: center;
    top: 50%;
    left: 50%;
    white-space: nowrap;
}

.loader {
    position: fixed;
    border: 12px solid #f3f3f3; /* Light grey */
    border-top: 12px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 80px;
    height: 80px;
    animation: spin 2s linear infinite;
    opacity: 0.5;
    filter: Alpha(opacity=50);
}

#txtLoader {
    Color: #f3f3f3;
    font-size: 14px;
    margin: 83px 0 0 10px;
}
<div class = "LoaderText">
    <a class="loader" [ngClass]= "{busyloader: IsBusy}" ></a>        
    <p id = "txtLoader">{{BusyContent}}</p>
</div>

This code is working well in Chrome but does not work in IE11. {{BusyContent}} under the loader image is not centrally aligned in IE. I have tried with align-items: center and vertical-align: middle, but no success. I want to fix this issue and it should work properly in both Chrome and IE.

IE11:

Image in IE

Chrome:

Image in Chrome

Can some please provide me some inputs on the same?

Vadim Ovchinnikov
  • 13,327
  • 5
  • 62
  • 90
Vanu
  • 63
  • 1
  • 12

2 Answers2

0

Check if this helps...

<!DOCTYPE html>
<html>
    <head>
        <style>
            body{background-color:#000000;}
            .LoaderText {
                position: fixed;
                top: 50%;
                left: 50%;
                height:150px;
                width:250px;
                margin-left:-125px;
                margin-top:-75px;
            }
            .loader {
                border: 12px solid #f3f3f3; /* Light grey */
                border-top: 12px solid #3498db; /* Blue */
                border-radius: 50%;
                width: 80px;
                height: 80px;
                animation: spin 2s linear infinite;
                opacity: 0.5;
                filter: Alpha(opacity=50);
                margin:auto;
                display:block;
                text-align:center;
            }
            #txtLoader {
                Color: #f3f3f3;
                font-size: 14px;
                position: absolute;
                left:0;
                right:0;
                bottom:0;
                height:20px;
                text-align:center;
            }
        </style>
    </head>
    <body>
        <div class = "LoaderText">
            <a class="loader" class= "busyloader" ></a>
            <p id = "txtLoader">Content are loading. Please wait...</p>
        </div>
    </body>
</html>
Shakthi
  • 826
  • 3
  • 15
  • 33
-5

.LoaderText {
    position: fixed;
    height: 0;
    width: 0;
    display:-moz-box;
    -moz-box-orient:horizontal;
    -moz-box-pack:center;
    -moz-box-align:center;

    /* Safari and Chrome */
    display:-webkit-box;
    -webkit-box-orient:horizontal;
    -webkit-box-pack:center;
    -webkit-box-align:center;

    /* W3C */
    display:box;
    box-orient:horizontal;
    box-pack:center;
    box-align:center;

    /* IE10 */
    display: -ms-flexbox;
    -ms-flex-align: center;
    -ms-flex-pack: center;
    -ms-box-orient:horizontal;
    top: 50%;
    left: 50%;
    white-space: nowrap;
}

.loader {
    position: fixed;
    border: 12px solid #f3f3f3; /* Light grey */
    border-top: 12px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 80px;
    height: 80px;
    animation: spin 2s linear infinite;
    opacity: 0.5;
    filter: Alpha(opacity=50);
}

#txtLoader {
    Color: #f3f3f3;
    font-size: 14px;
    margin: 83px 0 0 10px;
}
<div class = "LoaderText">
    <a class="loader" [ngClass]= "{busyloader: IsBusy}" ></a>        
    <p id = "txtLoader">{{BusyContent}}</p>
</div>

I have changed your CSS with some additional properties.

Hope this helps.

Bhavin Shah
  • 2,462
  • 4
  • 22
  • 35