【发布时间】:2017-06-08 19:18:44
【问题描述】:
我想在我的网站上使用 Lato light google 字体。
为每条指令添加了链接 herf=... 和字体系列标签,但它无法正常工作。
在我安装了 Lato 字体的笔记本电脑上,我看到实现了 Lato light font;但是,在我朋友的电脑和手机上,我没有看到 Lato 浅字体(我看到的是一些随机字体)
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
<head>
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
body {
font-family: 'Lato', sans-serif;
background-color: white;
font-weight: 300;
color: #595959;
letter-spacing: 1.4px;
}
我不知道问题是什么——当我删除 font-family: 'Lato', sans-serif;在 body { 下方,我不再在我的计算机上看到 Lato 字体......所以它可以正常工作,但非常正确。
输入将不胜感激!!!
【问题讨论】:
-
像这样使用重要的“font-family: 'Lato', sans-serif !important;”
-
我将首先添加一个 doctype 声明,因为没有它,页面在技术上是无效的,这会使您的渲染模式有些不可预测。
-
这里工作正常。检查这个小提琴jsfiddle.net/j1ajzo4p。为了更好地理解,我更改了一些元素。
-
它的开头有 ttp://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" rel="nofollow" target="_blank">w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">。这是你的意思吗? @TiesonT。
-
@OmarFaruque 没用:/