Set default CSS class for field

I am making a card template and I want {{MyField}} to always be formatted with a certain CSS style.

I can do <div class="MyField">{{MyField}}</div> each time, but ideally I could just say {{MyField}} and use . MyField { } CSS.

Is something like that possible?

No, it’s not. {{MyField}} gets replaced by the contents of that field (e.g. just plain text strings). There is no div or similar that would get inserted along side it. See this:

{{Front}} gets replaced with Question? (the content of that field).

Edit: If you know C: it’s somewhat similar to how #define works with the preprocessor.

2 Likes

You can make your own html tags like <m>{{MyField}}</m> and style them like this m {...}. Make sure to not conflict with existing tags though.

1 Like

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