Anki HTML, CSS second image class

Anki HTML, CSS how to add a second image class

I want to have a choice to have an image in black and white on the same note or maybe have a color image image on the same note.

How do I add a second image class to anki notes. So that I can chose which image to display.

So I want to have multiple fields on the note type. One field would color the image the grayscale and on other field would keep the image in color.

Pleas help

Hi, you can have one single image and apply the grayscale via CSS. No need to duplicate images. For example:

Front:
<div class="gray">{{nameOfTheField}}</div>

Back:
<div class="">{{nameOfTheField}}</div>

Styling:

.gray {
  filter: grayscale(100%);
}
3 Likes

Thank you it’s works.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.