Adding background image

I tried adding a background image to my Anki deck. It didn’t work.

In the media collection file is added an image file titled :


Taking the following coding, I tried putting this in the styling section :

body {
  background-image: <img src="image.jpg">;
  background-repeat: no-repeat;
  background-attachment: fixed; 
  background-size: 100% 100%;

I also tried in place of <img src="image.jpg"> :

img src="image.jpg"
img src=image.jpg
img src='image.jpg'

None of these alternatives worked.

Try background-image: url("image.jpg");


In addition to ankipalace’s answer, I suggest renaming the image.jpg file to _image.jpg to make the Check Media function recognizes the file as used.

See for more details.