-1

Is it good practice to embed images as data/base64 in a div block ?

<div style="background-image" url(data:image/png;base64, ...)></div>
Anas Radi
  • 17
  • 4

1 Answers1

1

Yes i think, this has some cool benefits.

  • this improves offline access of image .
  • this eliminates the need for separate HTTP requests for each image. This can potentially improves page load times, especially for small images.
Gururaj
  • 157
  • 9
  • ... and it can also be absolutely counter-productive, if the same image is used across multiple pages - because then you eliminate any possibility of properly _caching_ the image. – CBroe Aug 07 '23 at 07:56