我是全新的网站设计和编程。我在Mobirise上创建了一个网站,并将其存储在Github上。我期待着改变整个网站的字体,因为我不再喜欢我在Mobirise上选择的字体,当我将它导出到Github时。
我已经将需要使用的字体文件上载到存储库中的/OpenSansFonts文件夹:https://github.com/SkyBetChampionship/Sky-Bet-Championship/tree/gh-pages。
有谁能告诉我下一步做些什么来改变我网站上的字体?
提前谢谢你,
亚当
发布于 2019-07-27 18:12:28
您可以使用此代码创建单独的*.css文件,也可以在您的home.html中添加此代码(如果您创建了单独的文件,请不要忘记在您的home.html中导入该文件。
@font-face {
font-family: 'OpenSans-Light';
src: url('/OpenSansFonts/OpenSans-Light.ttf') format('truetype');
font-weight: 300;
font-style: normal;
}
@font-face {
font-family: 'OpenSans-Light';
src: url('/OpenSansFonts/OpenSans-LightItalic.ttf') format('truetype');
font-weight: 300;
font-style: italic;
}
@font-face {
font-family: 'OpenSans';
src: url('/OpenSansFonts/OpenSans-Regular.ttf') format('truetype');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'OpenSans';
src: url('/OpenSansFonts/OpenSans-RegularItalic.ttf') format('truetype');
font-weight: 400;
font-style: italic;
}
@font-face {
font-family: 'OpenSans-Semibold';
src: url('/OpenSansFonts/OpenSans-SemiBold.ttf') format('truetype');
font-weight: 600;
font-style: normal;
}
@font-face {
font-family: 'OpenSans-SemiBold';
src: url('/OpenSansFonts/OpenSans-SemiBoldItalic.ttf') format('truetype');
font-weight: 600;
font-style: italic;
}
@font-face {
font-family: 'OpenSans';
src: url('/OpenSansFonts/OpenSans-Bold.ttf') format('truetype');
font-weight: 700;
font-style: normal;
}
@font-face {
font-family: 'OpenSans';
src: url('/OpenSansFonts/OpenSans-BoldItalic.ttf') format('truetype');
font-weight: 700;
font-style: italic;
}
@font-face {
font-family: 'OpenSans';
src: url('/OpenSansFonts/OpenSans-ExtraBold.ttf') format('truetype');
font-weight: 800;
font-style: normal;
}
@font-face {
font-family: 'OpenSans';
src: url('/OpenSansFonts/OpenSans-ExtraBoldItalic.ttf') format('truetype');
font-weight: 800;
font-style: italic;
}要跨网站更改字体,请在body中添加资产/mobirise/css/mbr-addtional.css字体-系列属性。
body {
font-family: 'OpenSans';
font-weight: 400;
font-style: normal;
line-height: 1.5;
}要用字体导入单独的css文件,请在home.html中添加大约42个字符串,如下代码:
<link rel="stylesheet" href="your_path_to_file/file_with_fonts.css" type="text/css">当您需要另一种字体样式时,请使用字体-系列、字体权重和字体样式属性。
请随意问其他问题:)希望这能帮助你
https://stackoverflow.com/questions/57234385
复制相似问题