Chrome

时间:2016-08-12 09:42:57

标签: css

我在Google Chrome中遇到了字体问题,我认为这是由Windows中的问题引起的。当我启动Google Chrome时,它会打开位于我的硬盘上的网站。它是我自己制作的HTML网站,其中包含我最喜欢的所有网站。在css代码中,我选择了Dina字体作为要显示的主要字体。直到上周左右,当Chrome以某种方式用标准的Times New Roman字体覆盖Dina字体时,一切正常。

我检查了一切,我不知道它来自哪里。 html文件还没有被更改,奇怪的是Firefox和Edge也忽略了Dina字体。

安装该字体是因为它在Notepad ++中工作。所以没有任何错误。

我还在css中将Dina字体更改为Arial以查看是否有效,Chrome确实显示Arial字体,因此css脚本似乎没有任何问题。

链接到字体:https://www.donationcoder.com/Software/Jibz/Dina/

我希望有人可以帮我在谷歌浏览器中再次显示Dina字体。

CSS代码:

a:link  {color: #d3d3d3 ; text-decoration: none; font-weight: normal;}
a:visited {color: #d3d3d3; text-decoration: none; font-weight: normal;}
a:active {color: #d3d3d3; text-decoration: none; font-weight: normal;}
a:hover {color: #FFFFFF; text-decoration: none; font-weight: normal;}
.td {vertical-align: top; width: 12%;} 
.table {width: 100%;}
.divInfo    {width: 100%; font-family: Dina; font-size : 14px; line-height: 20px; display:none; padding-left:5px;}
.text   {width: 100%; font-family: Dina; font-size : 14px; line-height: 20px; color : #d3d3d3; text-decoration : none; display : inline-block;}
.kop {width: 100%; font-family: Dina; font-size : 14px; line-height: 20px; color : #ff8000; text-decoration : none; font-weight: bold;}    

提前致谢!

1 个答案:

答案 0 :(得分:1)

尝试在CSS的开头添加以下内容:

@font-face {
  font-family: "Dina";
  src: url(https://www.donationcoder.com/Software/Jibz/Dina/...) format("truetype");
}

其中https://www.donationcoder.com/Software/Jibz/Dina/...是指向包含字体,扩展名为.ttf.otf或类似字体的文件的链接,后跟format("truetype")format("opentype")分别

所以基本上要确保字体链接正确。

TimesNewRoman是默认的字体系列,因此无论何时找到您尝试使用的内容都无法使用。