- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试创建我的第一个网站,并且正在尝试使用 fontsquirrel 的字体。
唯一的问题是我只能使用通过网站下载的部分字体。
当字体系列包含多个样式时,我遇到了很多问题,尤其是在正确编写 css 代码方面。
让我们以 LM Mono 10 Regular 和 Special Elite 为例:
我的特殊精英代码如下,效果很好:
@font-face {
font-family: 'specialelite';
src: url('specialelite.eot');
src: url('specialelite.eot?#iefix') format('embedded-opentype'),
url('specialelite.woff2') format('woff2'),
url('specialelite.woff') format('woff'),
url(' specialelite.ttf') format('truetype'),
url(' specialelite.svg# specialelite') format('svg');
font-weight: normal;
font-style: normal; }
AND
.fifth {font-family: 'specialelite'; font-weight: normal; font-size: 16px; color:black;}
但是.. 当我试图在 LM Mono 10 系列的任何风格上调整这种格式时,它根本不起作用....
http://www.fontsquirrel.com/fonts/Latin-Modern-Mono
我现在已经尝试了两天零几个小时,而且我正处于严重危机的边缘......我不知道错误是否在我指的字体系列的方式上,或者我是否写了url 错误...拜托,我真的求求你了,你能在回复中提供一个代码示例吗?
假设为“Latin Modern Mono Light 10 Regular”..
我只是不明白..
提前谢谢你,
亚历山德罗斯。
最佳答案
我刚刚设法让你的字体正常工作看看我的代码我把所有文件都放在名为 HTML 的根目录中
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Font Test</title>
<style>
@font-face{
font-family: 'MyWebFont';
src: url('lmmono10-regular-webfont.eot');
src: url('lmmono10-regular-webfont.eot?iefix') format('eot'),
url('lmmono10-regular-webfont.woff') format('woff'),
url('lmmono10-regular-webfont.ttf') format('truetype'),
url('lmmono10-regular-webfont.svg#webfont') format('svg');
}
p { font-family: 'MyWebFont'; }
</style>
</head>
<body>
<p>My Test</p>
</body>
</html>
希望对你有帮助
关于css - 使用来自 fontsquirrel 的 @font-face 和字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35675134/
我目前正在建立一个同时使用希腊语和英语的本地 joomla 网站,我想更改字体。我访问了 fontsquirrel 并下载了支持希腊语的字体“Helsinki”(http://www.fontsqui
我遇到了 fontsquirrel 网络字体生成器的问题。输出字体文件中不存在两个特殊的匈牙利字符 (ő, ű),而输入文件存在。另一方面,我找不到任何设置(比如在 Cufon 中)来设置包中应该或不
我下载了这个字体(https://www.google.com/fonts/#QuickUsePlace:quickUse/Family:Underdog),然后使用了 FontSquirrel(ht
我正在尝试使用从 http://www.fontsquirrel.com/ 下载的字体.我附加的文件包含在字体文件夹中,在我的 HTML 文件中我有一个 标有“Hello font”的标签。 但是它不
我正在使用令人惊叹的新字体 Source Sans Pro作为我的基本字体(它确实质量很好,我受够了到处看到 Ariel)。 我的问题是,如果由于任何原因字体没有加载,并且由于字体大小的变化而恢复为
这个问题不太可能帮助任何 future 的访问者;它只与一个小的地理区域、一个特定的时间点或一个非常狭窄的情况相关,这些情况并不普遍适用于互联网的全局受众。为了帮助使这个问题更广泛地适用,visi
我已经从 font Squirrel 下载了一个字体 webkit 准确地说是这个GoodDog 在 floder 中,有一个名为 sample_files 的 floder - 它是什么,我的网站需
从 FontSquirrel 的字体生成器生成了几个 webfont 工具包,将它们放入 css 文件中,它们可以工作,但前提是这些文件与 css 文件位于同一目录中。 如何在指定不同的目录时让它们工
生成的图标过大,即使 font-size 设置为 16px,它看起来也像 32px 甚至更大。 我使用 [Octicons][2] 方法构建图标,因此 Glyphs 设置如下所示: 每 Em 的单位是
首先我应该提到我在 Tumblr 上工作,所以我在服务器端的东西方面有些受限。我知道这里有很多关于@font-face 的问题,但我就是找不到让它在 IE9 和 10 中工作的解决方案。我使用的是 F
我正在尝试创建我的第一个网站,并且正在尝试使用 fontsquirrel 的字体。 唯一的问题是我只能使用通过网站下载的部分字体。 当字体系列包含多个样式时,我遇到了很多问题,尤其是在正确编写 css
我一直在使用 Pictos 和 FontSquirrel 在我们的网络应用程序上制作花哨的图标和排版。今天我看到Droid 手机和Android 2.3.4(在VirtualBox 上运行)根本不显示
我使用@font-face 在站点上呈现自定义字体字体是“Ministry ExtraLight”我也在使用这个网站生成字体文件 http://www.fontsquirrel.com . 它在 Fi
我能够在 chrome 和 Firefox 中成功使用@font-face,但在 IE 中却不行: font-family: 'Market_Deco'; src: url('fonts/Market
Mac 火狐 (3.6.3)。字体在 Chrome、Safari、IE8 中看起来很清晰(不如其他 2 个好,但不如 Firefox 模糊)。任何解决方法?如何确定 Firefox 使用的是哪个源文件
我是一名优秀的程序员,十分优秀!