[英]Styling a CSS font face to have two custom fonts on a html page
我有一個網頁,該網頁成功使用了我在此處使用的兩個字體之一。 我希望用戶能夠看到以Cubano字體設置樣式的頂部菜單div標簽,而頁面的其余文本將保持打開狀態。 @ font-face似乎是唯一的,所以我不能在其中添加兩個字體家族。
編輯:演示可以在這里在rate1.html頁面上看到。
@font-face {
font-family: 'OpenSans';
src: url("fonts/opensans.ttf") format('truetype');
font-weight: normal;
font-style: normal
}
@font-face {
font-family: 'Cubano';
src: url("fonts/cubano-webfont.ttf") format('truetype');
font-weight: normal;
font-style: normal
}
body {
font: 32px/40px 'OpenSans', sans-serif;
color: #777;
}
body div.recent {
font: 32px/40px 'Cubano', sans-serif;
color: #777999;
}
對於Open Sans,您可以使用@import(在.css文件中):
@import url(https://fonts.googleapis.com/css?family=Open+Sans);
或將其鏈接到<head>
:
<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
在這里查看更多選項
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.