仅在 IE11 中填充主题图标可见,其他主题(轮廓、圆角、双色调、锐利)不可见。但是,当您在 IE11 浏览器 中打开 https://material.io/tools/icons/ 时,所有主题图标都可以正常工作。
因为 Google 对演示页面 https://material.io/tools/icons/ 上的所有主题图标使用不同的样式表。
Outlined:
<link rel="stylesheet" href="https://storage.googleapis.com/non-spec-apps/mio-icons/latest/outline.css">
Rounded:
<link rel="stylesheet" href="https://storage.googleapis.com/non-spec-apps/mio-icons/latest/round.css">
Two-Tone:
<link rel="stylesheet" href="https://storage.googleapis.com/non-spec-apps/mio-icons/latest/twotone.css">
Sharp:
<link rel="stylesheet" href="https://storage.googleapis.com/non-spec-apps/mio-icons/latest/sharp.css">
那么我们应该如何在 IE11 上显示圆形主题图标 - 非常简单
第 1 步:只需在代码中的样式表下方添加即可。
<link rel="stylesheet" href="https://storage.googleapis.com/non-spec-apps/mio-icons/latest/round.css">
第 2 步:如果您想显示 delete_forever 图标,只需在 delete_forever 之前添加 round- 并用作类。
<i class="round-delete_forever"></i>
第 3 步:你必须为它写一些样式,我只是创建新类mat-custom-icon,编写样式并添加<i class="round-delete_forever mat-custom-icon"></i>
.mat-custom-icon {
display: inline-block;
width: 24px;
height: 24px;
background-repeat: no-repeat;
background-size: contain;
}
下面的代码 sn-p 有所有提到的修复。试试这个,希望能帮到你。谢谢
.mat-custom-icon {
display: inline-block;
width: 24px;
height: 24px;
background-repeat: no-repeat;
background-size: contain;
}
<link href="https://fonts.googleapis.com/icon?family=Material+Icons+Round" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://storage.googleapis.com/non-spec-apps/mio-icons/latest/round.css">
This works
<i class="material-icons">
delete_forever
</i>
This does not
<i class="material-icons-round">
delete_forever
</i>
This will work on IE11
<i class="round-delete_forever mat-custom-icon"></i>