In dev server the loaderalignment is center comming into mobile view alignments has been changed then how i can get both alignment as center could you please send me the code?
Loading
In dev server the loaderalignment is center comming into mobile view alignments has been changed then how i can get both alignment as center could you please send me the code?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Naimish MakwanaRank #324 · 7.7K reputationPosted Feb 22, 2023, 5:18 AM EST
Hello Latha,
You can use below CSS to show loader in centre screen.
.loader-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; background-color: rgba(0, 0, 0, 0.5); z-index: 9999; } .loader { border: 8px solid #f3f3f3; border-top: 8px solid #3498db; border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }Then use is like below:
Thanks
Naimish Makwana
Latha Donepudi30 reputationPosted Feb 22, 2023, 7:37 AM EST
while taking this code got loder center in mobile view, but desktop view changed
Latha Donepudi30 reputationPosted Feb 22, 2023, 7:49 AM EST
this is my code for loader give me any suggestions
Deepak RawatRank #646 · 3.7K reputationPosted Apr 24, 2023, 11:57 AM EDT
.loader { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); /* other styles for the loader */ }the loader should be centered in both desktop and mobile views. You can adjust other CSS styles as per your requirements.