Does hiding an animated GIF with CSS conserve browser resources?

前端 未结 4 1297
庸人自扰
庸人自扰 2021-02-20 10:10

I have a gif image. It gets shown only on very specific events, not too often. By default, the gif\'s html tag is hidden using display: none

4条回答
  •  野的像风
    2021-02-20 11:04

    If you are hiding any imges(s) / iframe(s) through css's display:none or you are hiding any div (or other tag) through this css rule (display:none), image(s) / iframe(s) etc within this tag will not be loaded in the browser. It means browser will not make http request for these elements.

    Browser will sent the request to the server after you change the display property to other then none.

    It is not about img, but all the resources which makes server requests.

提交回复
热议问题