I have problem that my font isn't displaying one Danish letter, and I need to change like in whole text for that one letter font and size. Maybe it is possible with jquery, css or etc. ? And if it is possible, I have textarea where user can type text and if he types that letter maybe it is possible to change it too? (if it helps that danish letter is ø or ø). PS Sorry I didn't described the problem propely. Other Danish letters is showing normally, but my font doesn't support only one letter and I want to change it.
You may be going through more trouble to solve this than is necessary. It sounds like your page has the wrong character encoding.
http://en.wikipedia.org/wiki/Character_encodings_in_HTML
Try adding this to the head section of your html:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
It is possible, and relatively easy, to change each occurrence of a character to some expression using jQuery (and not very difficult in plain JavaScript either). The expression could be a span
(or font
) element containing the character and desired styling for it. Cf. to Change color of a character
In CSS, you could use @font-face
with unicode-range
to change the font family of a character everywhere. But not font size.
But as @dqhendricks suggests, the real problem may be something else. It could be an encoding problem. Or it can be a font problem: perhaps the primary font suggested on your page does not contain the letter “ø”. You can check this by trying to enter “ø” using that font in a simple text editor. In that case, the best solution is to find a better font.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.