更改“材质设计”图标的图标大小 [英] Change the icon size of Material Design icon

查看:138
本文介绍了更改“材质设计”图标的图标大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已引用然后声明了一个图标

I have referenced then declared an icon

<i class="material-icons">face</i>

但我该如何更改图标大小?

But how can I change the icon size?

在官方网站 https://design.google.com/icons/ 我可以看到他们使用<$这样的课程c $ c> class =md-icon dp48但它在我的情况下不起作用。

On oficial site https://design.google.com/icons/ I can see they using classes like class="md-icon dp48" but it is not working in my case.

推荐答案

通过阅读github中的材料设计,我发现这些有用的东西可能对你有帮助。

By reading the material design in github I found these useful stuff that might help you.

 /* Rules for sizing the icon. */
.material-icons.md-18 { font-size: 18px; }
.material-icons.md-24 { font-size: 24px; }
.material-icons.md-36 { font-size: 36px; }
.material-icons.md-48 { font-size: 48px; }

/* Rules for using icons as black on a light background. */
.material-icons.md-dark { color: rgba(0, 0, 0, 0.54); }
.material-icons.md-dark.md-inactive { color: rgba(0, 0, 0, 0.26); }

/* Rules for using icons as white on a dark background. */
.material-icons.md-light { color: rgba(255, 255, 255, 1); }
.material-icons.md-light.md-inactive { color: rgba(255, 255, 255, 0.3); }

从上面的代码中,您只需更改或覆盖材料css图标。

From the code above, there you can simply change or override the material css icons.

示例代码:

<i class="material-icons md-18">face</i>

更多详情这里

这篇关于更改“材质设计”图标的图标大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆