问题描述
我遇到的问题与通过 text-transform:uppercase
属性大写希腊字符有关。
The issue I came across has to do with the capitalization of Greek characters by the text-transform: uppercase
property.
在希腊语中,元音可以有小写和大写的尖锐口音,例如希腊语中的一个 。在句子的开头是Ένα。但是,当字词或短语以所有大写编写时,希腊语语法会说没有重音符号。
In Greek, vowels can have acute accents, both small and caps, for instance one in Greek is ένα. In the beginning of a sentence would be Ένα. But when a word or a phrase is written in all caps then Greek grammar says that it should have no accented letters.
现在,CSS的 text-transform:uppercase
大写希腊字母保留重音,这是语法错误的(所以ένα
As it is now, CSS's text-transform: uppercase
capitalizes Greek letters preserving accents which is grammatically wrong (so ένα becomes ΈΝΑ, while it should be ΕΝΑ).
如何使文本转换:大写
How do I make text-transform: uppercase
work properly for Greek?
推荐答案
。仅仅指定希腊字符不告诉CSS该语言是希腊语;在一些父元素(直到并包括 html
标记)上需要 lang
属性。
CSS will handle this fine if it knows that the language is Greek. Merely specifying Greek characters does not tell CSS that the language is Greek; that requires the lang
attribute on some parent element (up to and including the html
tag).
<p lang='el' style="text-transform: uppercase">ένα</p>
应该为您完成工作,
ΕΝΑ
请参阅fiddle at 。
See fiddle at http://jsfiddle.net/34tww2g8/.
这篇关于如何进行文本转换:大写与希腊语正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!