+ 1

Why does my css loading code fail to appear in the middle and be hidden?

Specific code is at the following link: https://sololearn.com/compiler-playground/WaewbOxFk180/?ref=app

13th Jul 2024, 6:33 AM
Nguyễn Viễn
Nguyễn Viễn - avatar
2 Antworten
+ 2
you are supposed to let your loader run immediately, then hide it after the page loads. Not run it after it loads. onload = () => { document.querySelector('.line').style.display = 'none'; } so delete the parts in the .line class that hides the loader. It should be visible by default. your loader is not centered because you used position:relative; on your line class. Use absolute instead.
13th Jul 2024, 8:45 AM
Bob_Li
Bob_Li - avatar
13th Jul 2024, 11:38 AM
Bob_Li
Bob_Li - avatar