html - 如何在shopify网站中添加自定义字体

标签 html css fonts shopify

我已添加字体代码

    @font-face {   font-family: 'Gotham-Book';   src:url('{{ "Gotham-Book.eot" | asset_url }}');   src:url('{{ "Gotham-Book.eot"
    | asset_url }}#iefix') format('embedded-opentype'),
    url('{{ "Gotham-Book.woff" | asset_url }}') format('woff'),
    url('{{ "Gotham-Book.ttf" | asset_url }}') format('truetype'),
    url('{{ "Gotham-Book.svg | asset_url }}#Gotham-Book') format('svg');      font-weight: normal;   font-style: normal; }

还上传了资源文件夹中的字体文件。

Question: How to use font for all headings, My theme using sass variables,

最佳答案

Upload font files in assets folder

If your font has multiple files, you will have to repeat this process for each one.

enter image description here

Link The Fonts In Your CSS

Open your theme’s CSS file. In most themes, this is called theme.scss.liquid

@font-face {
    font-family: 'your-font';
    src: url('./your-font.eot');
    src: url('./your-font.eot?#iefix') format('embedded-opentype'),
         url('./your-font.woff2') format('woff2'),
         url('./your-font.woff') format('woff'),
         url('./your-font.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

Replace font-family in your theme.scss.liquid

关于html - 如何在shopify网站中添加自定义字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43271508/

相关文章:

javascript - 扩展搜索框覆盖导航栏上的链接

javascript - Bootstrap 3 允许列溢出容器

C#计算给定宽度的字符串的高度

fonts - 将 Base64 字体转换回 ttf 或 otf

javascript - Node Js、javascript、mysql,客户端看到/看不到什么?

javascript - 在 Smart Mobile Studio 中为 Box2D 对象添加颜色

css - 在 rails 3 中使用带有 button_to "delete"的 Bootstrap 图标

html - 另一个 div 内的 div 未扩展到页面高度,仅扩展到屏幕高度

javascript - 如何使用 jquery 在 html 表中搜索范围?

css - 包含哈希时,Chrome 不会为字体呈现 svg