Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何覆盖引导字体系列?_Html_Css_Bootstrap 4 - Fatal编程技术网

Html 如何覆盖引导字体系列?

Html 如何覆盖引导字体系列?,html,css,bootstrap-4,Html,Css,Bootstrap 4,我的自定义CSS @font-face { font-family: 'DINAlternateBold'; src: url(./fonts/din/DINAlternateBold.otf); } h4.DINAlternateBold-font { font-family: 'DINAlternateBold', sans-serif !important ; } html标记 <h4 class="DINAlternateBold-fon

我的自定义CSS

@font-face {
    font-family: 'DINAlternateBold';
    src: url(./fonts/din/DINAlternateBold.otf);
    }

h4.DINAlternateBold-font {
    font-family: 'DINAlternateBold', sans-serif !important ;
    }
html标记

<h4 class="DINAlternateBold-font text-uppercase">Dashboard</h4>

确保css链接位于引导链接之后,这将帮助您覆盖它。 例如:


您所使用的
!重要信息
覆盖引导定义

@font-face{
字体系列:“DINAlternateBold”;
src:url(./font/din/DINAlternateBold.otf);
}
h4.DINEBOLD-font{
字体系列:'DINAlternateBold',无衬线!重要;
}

仪表板

我没有覆盖
检查您的代码工作是否完美(覆盖引导)您发布了什么?字体系列在我的html文件中没有改变,它显示了这个字体系列“'-apple system,BlinkMacSystemFont,“Segoe UI”,Roboto,“Helvetica Neue”控制台样式中的“、Arial、sans serif”。不明白为什么会这样我忘了在angular-cli.json文件中包含
font-family": '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'