首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我如何改变我的网站的字体在吉突布网页上?

我如何改变我的网站的字体在吉突布网页上?
EN

Stack Overflow用户
提问于 2019-07-27 17:12:19
回答 1查看 1.2K关注 0票数 0

我是全新的网站设计和编程。我在Mobirise上创建了一个网站,并将其存储在Github上。我期待着改变整个网站的字体,因为我不再喜欢我在Mobirise上选择的字体,当我将它导出到Github时。

我已经将需要使用的字体文件上载到存储库中的/OpenSansFonts文件夹:https://github.com/SkyBetChampionship/Sky-Bet-Championship/tree/gh-pages

有谁能告诉我下一步做些什么来改变我网站上的字体?

提前谢谢你,

亚当

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-07-27 18:12:28

您可以使用此代码创建单独的*.css文件,也可以在您的home.html中添加此代码(如果您创建了单独的文件,请不要忘记在您的home.html中导入该文件。

代码语言:javascript
复制
@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字体-系列属性。

代码语言:javascript
复制
body {
  font-family: 'OpenSans';
  font-weight: 400;
  font-style: normal;
  line-height: 1.5;
}

要用字体导入单独的css文件,请在home.html中添加大约42个字符串,如下代码:

代码语言:javascript
复制
<link rel="stylesheet" href="your_path_to_file/file_with_fonts.css" type="text/css">

当您需要另一种字体样式时,请使用字体-系列字体权重字体样式属性。

请随意问其他问题:)希望这能帮助你

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57234385

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档