avatar

ShinChven's Blog

Fullscreen Centered Loading Indicator in React Root DIV

css, html2022-06-16 18:04:57

I am putting a spinning progress image in the center of the react root div as the loading progress indicator.

<!DOCTYPE html>
<html lang="en">
<head>
    <title>Full Screen Centered Spinning</title>
    <style>
        .loading{
          display: flex;
          flex-direction: row;
          align-content: center;
          justify-content: center;
          min-height: 100vh; /* inner div to 100% screen height */
        }
    </style>
</head>
<body>
<div id="root">
    <div class="loading">
        <img alt="loading" src="images/spinner.svg" />
    </div>
</div>
</body>
</html>