关于html:使用CSS在Copperplate Gothic中渲染单词的首字母大写

Capitalizing the first letter of a word by using CSS to render it in Copperplate Gothic

我在网站主菜单中使用'Copperplate Gothic'字体。由于Copperplate Gothic具有全大写字母的性质,因此我在某些地方使用它来将每个单词的首字母大写。如何使用CSS将字形" Copperplate Gothic"分配给单词的第一个字母?


Copperplate Gothic字体默认为小写字母,并且不会获取该字体的小写字母。
"尽管从未设计过真正的小写字母,但是Copperplate Gothic是通常以小字体设置的全大写文本的理想选择"
参考:http://www.microsoft.com/typography/fonts/family.aspx?FID=40


嘿,现在用这个

1
2
3
{
text-transform: capitalize !important;
}


您可以通过text-transforn属性轻松获得所需的结果。

CSS

1
 p.capitalize {text-transform:capitalize;}

HTML

1
<p class="capitalize">This is some text.This is some textThis is some textThis is some textThis is some textThis is some textThis is some textThis is some textThis is some textThis is some textThis is some textThis is some textThis is some textThis is some textThis is some textThis is some textThis is some textThis is some textThis is some textThis is</p>

请参阅演示:-http://jsfiddle.net/dkxUX/18/


1
text-transform:capitalize;

您可以添加CSS