Ste*_*eve 4 html css html5 twitter-bootstrap
我想在我的HTML网站的CSS中的font-family属性中使用googles"source sans pro"字体.我使用Bootstrap作为前端框架.
https://www.google.com/fonts/specimen/Source+Sans+Pro
我怎样才能做到这一点?我是否必须将该文件包含在我的html网站中?
感谢您的任何帮助!
Igo*_*cha 15
在head您网站的部分添加此字符串:
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro' rel='stylesheet' type='text/css'>
Run Code Online (Sandbox Code Playgroud)
然后使用这个字体:
h1 {
font-family: 'Source Sans Pro', sans-serif;
}
Run Code Online (Sandbox Code Playgroud)
说明位于您显示的页面顶部的链接上。https://www.google.com/fonts#UsePlace:use/Collection:Source+Sans+Pro
您可以将其添加到页面的头部:
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro' rel='stylesheet' type='text/css'>
Run Code Online (Sandbox Code Playgroud)
并在 CSS 中指定字体系列。
element {
font-family: "Source Sans Pro"
]
Run Code Online (Sandbox Code Playgroud)