有没有办法在不使用图像的情况下在网站上添加一些自定义字体,Flash还是其他图形?
例如,我在一个婚礼网站上工作,我为这个主题找到了很多不错的字体。但我找不到在服务器上添加该字体的正确方法。以及如何将带有 CSS 的字体包含到 HTML 中?这可以在没有图形的情况下完成吗?
最佳答案
这可以通过 CSS 完成:
<style type="text/css">
@font-face {
font-family: "My Custom Font";
src: url(http://www.example.org/mycustomfont.ttf) format("truetype");
}
p.customfont {
font-family: "My Custom Font", Verdana, Tahoma;
}
</style>
<p class="customfont">Hello world!</p>
是supported for all of the regular browsers如果您使用 TrueType-Fonts (TTF)、Web Open Font Format (WOFF) 或 Embedded Opentype (EOT)。
关于html - 如何向网站添加一些非标准字体?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/107936/