[英]How can you change the background color of a mdl button?
Is there a way to change the background color of a FAB button from the framework of getmdl.io?有没有办法从 getmdl.io 的框架中更改 FAB 按钮的背景颜色? I've already tried to add one more classname to button and change background-color but it doesn't work.
我已经尝试向按钮添加一个类名并更改背景颜色,但它不起作用。
You can recolour a button by simply adding a color class to the list, this overwrites the existing color and uses the one you provide.您可以通过简单地向列表添加颜色类来重新着色按钮,这会覆盖现有颜色并使用您提供的颜色。
For example, a regular FAB button:例如,一个普通的 FAB 按钮:
<!-- Colored FAB button -->
<button class="mdl-button mdl-js-button mdl-button--fab mdl-button--colored">
<i class="material-icons">Some Text Here</i>
</button>
We can insert the color .mdl-color--amber-900
by adding it to the class list:我们可以通过将颜色
.mdl-color--amber-900
添加到类列表中来插入它:
<button class="mdl-button mdl-js-button mdl-button--fab mdl-button--colored mdl-color--amber-900">
<i class="material-icons">Some Text Here</i>
</button>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.