我正在将matirialize CSS文件导入到我的代码中。我已经从链接复制到代码,并在我的代码中创建了css文件,并像下面的代码一样将它们导入,这些是导入:(我不想从Internet导入,因为我也希望项目也可以在没有Internet的情况下工作。)< / p>
<script src = "jquery.js"></script>
<script src = "Sources/Chart.js"></script>
<link rel = "stylesheet" type="text/css" href = "Sources/bootstrap.css">
<script src = "client.js"></script>
<link rel = "stylesheet" type="text/css" href = "Sources/MatirialIcons.css">
<link rel = "stylesheet" type="text/css" href = "Sources/Matirialize.css">
<script type = "text/javascript"
src = "Sources/jquery-2.1.1.js"></script>
<script src = "Sources/Matirialize.js"></script>
答案 0 :(得分:2)
如果字体有问题,您应该像@Arkellys所说的那样定义字体系列。
执行以下步骤:
步骤1::转换下载的字体https://web-font-generator.com/
步骤2:下载生成的字体
第3步:打开字体目录(字体/字体名称)并在其中包含下载的字体
第4步:在样式表中添加字体外观
第5步:调用样式表
@font-face {
font-family: 'fontName';
src: url('../fonts/fontName/fontName.eot'); /* IE9 Compat Modes */
src: url('../fonts/fontName/fontName.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../fonts/fontName/fontName.woff') format('woff'), /* Pretty Modern Browsers */
url('../fonts/fontName/fontName.ttf') format('truetype') /* Safari, Android, iOS */
}
答案 1 :(得分:1)
我找到了解决方案: 在matirialize图标文件中,有字体文件导入 (这是matirialize图标的CSS文件):
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: local('Material Icons'), local('MaterialIcons-Regular'), url(https://fonts.gstatic.com/s/materialicons/v22/2fcrYFNaTjcS6g4U3t-Y5ZjZjT5FdEJ140U2DJYC3mY.woff2) format('woff2');
}
.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
-moz-font-feature-settings: 'liga';
-moz-osx-font-smoothing: grayscale;
}
所有需要打开的URL并下载文件,将其放入项目中,然后将上面的代码更改为:
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(iconfont/MaterialIcons-Regular.eot); /* For IE6-8 */
src: local('Material Icons'),
local('MaterialIcons-Regular'),
/* Old file: url(iconfont/MaterialIcons-Regular.woff2) format('woff2'), */
/* load new file */
url(flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format('woff2'),
url(iconfont/MaterialIcons-Regular.ttf) format('truetype');
}