I have weird issue, I’m using custom font in my project, when I add the * in html code
it appears as a special symbol, I will provide picture for it symbol appearing instead of *
<label for="{{ field.id_for_label }}">
{{ field.label }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}</label>
the class asteriskField must render it as *, currently I have made it to not appear,
.asteriskField {
display: none;
}
/* style.css */
@font-face {
font-family: 'AlJazeera'; /*a name to be used later*/
font-display: swap;
src: url('./fonts/Al-Jazeera-Arabic-Regular.ttf'); /*URL to font*/
}
So what I should do so the star symbol render as usual ?
I have tried contents: "*" , but it doesn’t appear as normal star
2
Answers
You can use
font-family: none;
to use the default font on theasterisk
The result should look like this
I took the liberty to turn my comment into an answer.
The asterisk gets rendered with the font you’ve set for the page, which is Al Jazeera. You can revert this decision by setting the font family to
initial
:The difference from this answer is that
font-family: none
is not a valid value forfont-family
. It may work, but it is not standardized.