I am using background image in style tag.
1 2 3 4 5 6 7 |
|
I want the image to fade in without adding a separate div to the page. Can this goal be achieved?
P粉9405389472024-03-30 19:07:40
Yes, it is possible. You can do this.
1 2 3 4 5 6 7 8 9 10 11 |
|
1 |
|
P粉5415512302024-03-30 13:40:37
This is a CSS-only approach. However, there is a caveat, CSS cannot wait for events, so it has no way of knowing when the entire site has loaded.
Instead, in this snippet, it waits 1 second before starting to introduce the background image that is located on the body's before pseudo-element.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
1 |
|