[英]CSS - Why is font-style: italic not applied for font-family: Helvetica, Arial, sans-serif?
For some reason, this rule is applied in Chrome on Mac, but not on Windows. 出于某种原因,此规则适用于Mac上的Chrome,但不适用于Windows。 The arrows at the bottom of the page should be italicized, but it only works on Mac. 页面底部的箭头应为斜体,但仅适用于Mac。
You can see the example here: http://jansensan.net/clients/float4/allianz-global-assistance/true-stories.html 你可以在这里看到这个例子: http : //jansensan.net/clients/float4/allianz-global-assistance/true-stories.html
You can see the CSS here: http://jansensan.net/clients/float4/allianz-global-assistance/assets/css/main.css 你可以在这里看到CSS: http : //jansensan.net/clients/float4/allianz-global-assistance/assets/css/main.css
Look for the .buttonLabel class. 寻找.buttonLabel类。
Just before you mention that it may work in IE or Firefox, these browsers are irrelevant to this project. 就在你提到它可能在IE或Firefox中运行之前,这些浏览器与这个项目无关。 The HTML output is into a custom Webkit integration that behaves identically to Chrome. HTML输出进入自定义Webkit集成,其行为与Chrome相同。
Is there something obvious that I overlooked? 我忽略了一些明显的东西吗? Thanks for any help! 谢谢你的帮助!
The reason appears to be that you are trying to italicize a character that has no italic version, ie it looks the same in an italic font as in a normal (upright) font. 原因似乎是你试图使一个没有斜体版本的字符斜体,即它看起来像斜体字体一样,与普通(直立)字体相同。 This is normal for special characters; 这对于特殊字符来说是正常的; using italic basically means using specially designed glyphs for letters and maybe for some other characters. 使用斜体基本上意味着使用专门设计的字母字形和其他一些字符。
The relevant markup here seems to be 这里的相关标记似乎是
<div class="buttonLabel label"><</div>
and the relevant CSS code 和相关的CSS代码
.buttonLabel
{
font-family: Verdana, sans-serif;
font-style: italic;
}
(Contrary to the question heading, I can't find any reference to Helvetica or Arial in the CSS code. And I can't find any arrows, just LESS THAN and GREATER THAN characters.) (与问题标题相反,我在CSS代码中找不到任何对Helvetica或Arial的引用。我找不到任何箭头,只有少于几个字符。)
In Verdana, the italic glyph for “<” is the same as the normal glyph. 在Verdana中,“<”的斜体字形与普通字形相同。 Ditto in Arial. 在Arial中也是如此。 In some other fonts, it might look different, though this should be regarded as a typographic flaw. 在其他一些字体中,它可能看起来不同,但这应该被视为印刷缺陷。 Some fonts, such as Arial Unicode MS, do not have an italic version at all. 某些字体(如Arial Unicode MS)根本没有斜体版本。 Some browsers and other programs may (erroneously) apply artificial “italic” to such fonts, by algorithmically slanting normal glyphs. 某些浏览器和其他程序可能(错误地)通过算法倾斜正常字形将这些字体应用于人工“斜体”。
The solution depends on what you are after. 解决方案取决于您的目标。 I cannot see a reason to try to italicize “<” or “>”, but if you wish to get some distorted slanted versions of such characters, using images is the practical solution. 我看不出尝试斜体“<”或“>”的理由,但是如果你想得到这些字符的一些扭曲的倾斜版本,使用图像是实用的解决方案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.