简体   繁体   English

如何将小写大写字母应用于字体系列?

[英]How to apply small caps to a font family?

Is it possible to apply small caps to a font family instead of a tag? 是否可以将小写字母应用于字体系列而不是标签? I am using the orator font (which is a small caps monospaced font) but I realise its not really web safe. 我正在使用演说者字体(这是一种小写的等宽字体),但我意识到它并不是真正的网络安全。 Andale looks similar and is web safe but isn't a small caps font. Andale看起来很相似,并且可以安全使用网络,但字体大小写不一。 So in the absence of orator I would like Andale to be called on with small caps without adding the small caps attribute to the orator. 因此,在没有演说者的情况下,我希望在不向演说者添加“小写”属性的情况下以小写形式调用Andale。 For the H1 tag. 对于H1标签。 How can I do this? 我怎样才能做到这一点?

Apply font-variant: small-caps to your H1 tag. font-variant: small-caps应用于H1标签。

Demo 演示

Consider using a different (more thinner) font and then use the :first-letter CSS3 selector to make the first letter larger instead. 考虑使用其他(更细)的字体,然后使用:first-letter CSS3选择器使第一个字母变大。 There are a number of Open-Type fonts similar to the one you posted. 有许多类似于您发布的Open-Type字体。

table.form td {
    padding: 10px;
    font-family: "Open Sans";
    font-variant: small-caps;
    font-size: 15px;
}

table.form td:first-letter {
    font-size: 18px;
}

Or Another way : 或另一种方式:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM