角材料排版 - 定制

问题描述 投票:0回答:1

在定制我的angular material theme's typography。我知道可以使用自己的字体覆盖默认字体,如下所示:

$custom-typography: mat-typography-config(
  $font-family: 'Lato, monospace'
);

虽然,我注意到the source code显示两种字体,默认的Roboto,然后Helvetica也包含在引号中:

$font-family: 'Roboto, "Helvetica Neue", sans-serif',

这是次要字体吗?我想如果我可以选择辅助字体。如果这不是辅助字体,它是什么?

谢谢

css angular angular-material angular-material-theming
1个回答
0
投票

font-family属性可以将多个字体名称作为“后备”系统。如果浏览器不支持第一种字体,它会尝试下一种字体。

从您想要的字体开始,并始终以通用系列结尾,让浏览器在通用系列中选择类似的字体,如果没有其他字体可用。

注意:用逗号分隔每个值。

注意:如果字体名称包含空格,则必须引用它。在HTML中使用“style”属性时,必须使用单引号。

复制自w3schools

© www.soinside.com 2019 - 2024. All rights reserved.