wordpress 更改字體:
- 改成微軟正黑體
body{font-family: arial,“Microsoft JhengHei”,“微軟正黑體“,sans-serif !important;}
- 在 Customer CSS裡面貼上以下:
@font-face {
/*圓體*/
font-family: ‘cwTeXYen’;
font-style: normal;
font-weight: 500;
src: url(//fonts.gstatic.com/ea/cwtexyen/v3/cwTeXYen-zhonly.eot);
src: url(//fonts.gstatic.com/ea/cwtexyen/v3/cwTeXYen-zhonly.eot?#iefix) format(’embedded-opentype’),
url(//fonts.gstatic.com/ea/cwtexyen/v3/cwTeXYen-zhonly.woff2) format(‘woff2’),
url(//fonts.gstatic.com/ea/cwtexyen/v3/cwTeXYen-zhonly.woff) format(‘woff’),
url(//fonts.gstatic.com/ea/cwtexyen/v3/cwTeXYen-zhonly.ttf) format(‘truetype’);
}
cwTeXFangSong(仿宋體)
@font-face {
/*仿宋*/
font-family: ‘cwTeXFangSong’;
font-style: normal;
font-weight: 500;
src: url(//fonts.gstatic.com/ea/cwtexfangsong/v3/cwTeXFangSong-zhonly.eot);
src: url(//fonts.gstatic.com/ea/cwtexfangsong/v3/cwTeXFangSong-zhonly.eot?#iefix) format(’embedded-opentype’),
url(//fonts.gstatic.com/ea/cwtexfangsong/v3/cwTeXFangSong-zhonly.woff2) format(‘woff2’),
url(//fonts.gstatic.com/ea/cwtexfangsong/v3/cwTeXFangSong-zhonly.woff) format(‘woff’),
url(//fonts.gstatic.com/ea/cwtexfangsong/v3/cwTeXFangSong-zhonly.ttf) format(‘truetype’);
}
cwTeXKai(楷體)
@font-face {
/*楷體*/
font-family: ‘cwTeXKai’;
font-style: normal;
font-weight: 500;
src: url(//fonts.gstatic.com/ea/cwtexkai/v3/cwTeXKai-zhonly.eot);
src: url(//fonts.gstatic.com/ea/cwtexkai/v3/cwTeXKai-zhonly.eot?#iefix) format(’embedded-opentype’),
url(//fonts.gstatic.com/ea/cwtexkai/v3/cwTeXKai-zhonly.woff2) format(‘woff2’),
url(//fonts.gstatic.com/ea/cwtexkai/v3/cwTeXKai-zhonly.woff) format(‘woff’),
url(//fonts.gstatic.com/ea/cwtexkai/v3/cwTeXKai-zhonly.ttf) format(‘truetype’);
}
cwTeXHei(黑體)
@font-face {
/*黑體*/
font-family: ‘cwTeXHei’;
font-style: normal;
font-weight: 500;
src: url(//fonts.gstatic.com/ea/cwtexhei/v3/cwTeXHei-zhonly.eot);
src: url(//fonts.gstatic.com/ea/cwtexhei/v3/cwTeXHei-zhonly.eot?#iefix) format(’embedded-opentype’),
url(//fonts.gstatic.com/ea/cwtexhei/v3/cwTeXHei-zhonly.woff2) format(‘woff2’),
url(//fonts.gstatic.com/ea/cwtexhei/v3/cwTeXHei-zhonly.woff) format(‘woff’),
url(//fonts.gstatic.com/ea/cwtexhei/v3/cwTeXHei-zhonly.ttf) format(‘truetype’);
}
調整「大小、字距、行高」
找到要改的區域元素,如果是標題,則會是 h1, h2, h3 ,內文則是 p 。
如果我要改文章的內容大小,則可以依照下方去修改。
p {
font-size: 18px; /* 字的大小 */
letter-spacing: 1px;/* 字距 */
line-height: 30px;/* 行高 */
}
就先這樣囉,我們下次見
若有 WordPress 相關問題,都可以透過下面的臉書連結聯繫。
- STEP1.
進入WordPress後台→外觀→主題編輯器→樣式表 (style.css)加入以下代碼→儲存
@import url(// fonts.googleapis.com/earlyaccess/ notosanstc.css);
STEP2.
接著一樣回到WordPress後台→外觀→編輯CSS→貼上以下代碼→儲存
body
{
font-family:’ Noto Sans TC ‘,sans-serif;
}
STEP3.
返回到你的首頁看看是否已經更新成功!
5.Embed Font
To embed your selected fonts into a webpage, copy this code into the <head> of your HTML document.
STANDARD @IMPORT
<link href=”https://fonts.googleapis.com/css?family=Noto+Sans+TC&display=swap” rel=”stylesheet”>
Specify in CSS
Use the following CSS rules to specify these families:
- font-family: ‘Noto Sans TC’, sans-serif;
0 Comments