6
.image--about {
    background: url(../img/ZIZF.gif) no-repeat center;
    background-size: cover
}

I have this CSS. I want to use lazy loading to following images that I load via CSS, can you please help me out?

1

1 Answer 1

2

I don't know if it possible to apply lazy loading by css but it 's possible with HTML by adding single attribute loading="lazy"

<img src="myimage.jpg" loading="lazy" alt="..." />

other values for loading like eager and auto

others method will required JavaScript check this 👉 Five Ways to Lazy Load Images for Better Website Performance

Sign up to request clarification or add additional context in comments.

3 Comments

Hey I have tried adding the folloewing attribute in images , but i just want to add it in css , my image loads via css , if you could help me so
I look for it but so far there is now way to load image by css only there is servals methods that include JavaScript and a single method as I mention in my answer
check this for more info web.dev/lazy-loading-images

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.