【发布时间】:2017-02-21 04:25:58
【问题描述】:
我正在尝试将 Google 字体添加到 Wordpress Cyberchimps 响应主题。
https://cyberchimps.com/forum-topic/where-do-i-override-the-default-font/
我尝试在标题中嵌入字体的链接,但它没有更新以使用它。
如何使用自定义字体?
【问题讨论】:
标签: css wordpress fonts wordpress-theming
我正在尝试将 Google 字体添加到 Wordpress Cyberchimps 响应主题。
https://cyberchimps.com/forum-topic/where-do-i-override-the-default-font/
我尝试在标题中嵌入字体的链接,但它没有更新以使用它。
如何使用自定义字体?
【问题讨论】:
标签: css wordpress fonts wordpress-theming
要在您的网站中使用 google 字体,您只需在页面顶部放置一个链接(与添加 css 文件类似)。像这样:-
<link href='https://fonts.googleapis.com/css?family=IM+Fell+DW+Pica' rel='stylesheet' type='text/css'>
然后像这样在你的 css 中访问它:-
.im-fell-dw-pica-font{
font-family: 'IM Fell DW Pica', sans-serif;
}
这里'IM Fell DW Pica'是所需的google字体。(请注意,sans-serif是在我们所需的字体'IM Fell DW Pica'之后定义的。这样做是为了如果我们的google字体不是浏览器加载无衬线字体由于某种原因加载。)
你现在可以像这样将这个类应用到你想要的元素上:-
<div class="im-fell-dw-pica-font">Some random text</div>
【讨论】:
closed 是什么意思?