Spyke
anki·Anki Unofficialbyx4740N

How to get anki {{FrontSide}} to ignore front side CSS styling on the back of the card

I'm using padding for the front side of the card to center Kanji on the front of the card because it makes it a bit easier for me visually but the padding is also applying to the back of the card as well

I dont want the padding to apply to {{FrontSide}} on the back of the card

I've already tried 0px styling for the back of the card but that doesn't stop the front side padding

I have no idea on how to get {{FrontSide}} on the back of the card to ignore front side CSS styling

View original on lemm.ee
lemm.ee

I'll probably just wrap the entire back of the card with a <div id='back'> tag.

As a more concrete example, let's say the front template of the card is something like this:

<div class="kanji" lang="ja">
    <p class="kanji-stroke-order" lang="ja">{{kanji}}</p>
</div>

The template for the back of the card would be:

<div class="backside">
  {{FrontSide}}

  <!-- Rest of the back template -->
</div>

And the CSS would be something like:

.kanji {
  padding: 1em;
}

.backside .kanji {
  padding: 0;
}

That is, by adding a backside class you can make sure that you can add the different CSS styling you want.

1
x4740Nreply
lemm.ee

I already know about class and id and am using them in the code

I'm using

And wrapping both the front and back sides of the card with p elements

Would it be helpful to see my code?, because I'm currently not at my PC and don't even know if I'm logged into lemmy on there

1

Yeah, it'd be very helpful if I can see your code: front template, back template, and the css.

1

You reached the end

How to get anki {{FrontSide}} to ignore front side CSS styling on the back of the card | Spyke