# "add mobile class" not working

**URL:** <https://forums.ankiweb.net/t/add-mobile-class-not-working/10380>\
**Category:** Help\
**Created:** [May 29, 2021, 7:12am UTC](https://forums.ankiweb.net/t/add-mobile-class-not-working/10380 "2021-05-29T07:12:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![adomazzz](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@adomazzz](https://forums.ankiweb.net/u/adomazzz)\
**Post date:** [May 29, 2021, 7:12am UTC](https://forums.ankiweb.net/t/add-mobile-class-not-working/10380/1 "2021-05-29T07:12:49Z")

</div>

For some reason add mobile class in Tools → Manage Note Types → Cards… → Preview → Options is not getting saved. I have css .mobile example class which I want to be used, however, it’s never working on AnkiDroid. When I check “add mobile class” and save, it says “changes saved”, but it’s never working and when I go to Tools → Manage Note Types → Cards… → Preview → Options it is always still unchecked. I went through all steps required before posting here. Could it be just something wrong with my Anki or is it more widely spread bug?

---

<div class="post-metadata">

**Author:** ![shallash](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/shallash/32/4363_2.png) [@shallash](https://forums.ankiweb.net/u/shallash)\
**Post date:** [May 29, 2021, 8:18am UTC](https://forums.ankiweb.net/t/add-mobile-class-not-working/10380/2 "2021-05-29T08:18:05Z")

</div>

Add mobile class is just a setting to preview how any css added for the mobile class would look.

Basically it adds the mobile class to the preview window. It doesn’t actually change anything in the styling.  
Let me know if I was unclear.

---

<div class="post-metadata">

**Author:** ![adomazzz](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@adomazzz](https://forums.ankiweb.net/u/adomazzz)\
**Post date:** [May 29, 2021, 8:22am UTC](https://forums.ankiweb.net/t/add-mobile-class-not-working/10380/3 "2021-05-29T08:22:31Z")

</div>

aaaa… okay, I thought it’s for enabling it in general. But then, maybe you know what could be the reason why doesn’t it work on AnkiDroid? Only the example class is not shown on mobile  
CSS:  
.mobile .example {  
font-family: arial;  
font-size: 15px;  
color: white;  
}  
CARD:  
{{FrontSide}}  
\<hr id=answer\>  
{{Back}}  
\<br\>\<br\>\<br\>  
\<div class=example\>\<b\>Examples:\</b\>  
{{Example}}\<br\>  
\<b\>Context: \</b\>{{Context}}  
\</div\>

---

<div class="post-metadata">

**Author:** ![shallash](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/shallash/32/4363_2.png) [@shallash](https://forums.ankiweb.net/u/shallash)\
**Post date:** [May 29, 2021, 11:45am UTC](https://forums.ankiweb.net/t/add-mobile-class-not-working/10380/4 "2021-05-29T11:45:15Z")

</div>

That’s odd, this syntax does work for my cards right now.

This seems silly, but could it be because you have the color set to white for the text?

---

<div class="post-metadata">

**Author:** ![adomazzz](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@adomazzz](https://forums.ankiweb.net/u/adomazzz)\
**Post date:** [June 4, 2021, 6:28pm UTC](https://forums.ankiweb.net/t/add-mobile-class-not-working/10380/5 "2021-06-04T18:28:20Z")

</div>

Sorry, only now I had time to look it up. So yeah, the problem seems to lie with the coloring. I use dark mode, which I didn’t test if it’s related, but when the text color is white in the mobile class, it’s not shown on the mobile itself, but if I change the color to let’s say blue, it shows yellow text on the mobile. Seems a bit odd, but I’ve got it working thanks to you. Do you know if I should report this somewhere as a bug or smth like that?

---

<div class="post-metadata">

**Author:** ![shallash](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/shallash/32/4363_2.png) [@shallash](https://forums.ankiweb.net/u/shallash)\
**Post date:** [June 6, 2021, 11:19am UTC](https://forums.ankiweb.net/t/add-mobile-class-not-working/10380/6 "2021-06-06T11:19:57Z")

</div>

It’s not a bug, AnkiDroid just applies inverted day-mode colors in night-mode, unless you specify colors for night-mode using a specific class name. It’s slightly different from the class used to apply night mode in the desktop. I’ve forgotten what exactly it is though. You can look it up in the docs.  
If you remove the `color: white;` it should default to white text on a black background in night mode. Or you could set the background color to black and use it in day mode.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [May 1, 2023, 5:02am UTC](https://forums.ankiweb.net/t/add-mobile-class-not-working/10380/7 "2023-05-01T05:02:16Z")

</div>


