Reputation: 377
I print this icon into a table using php code like this:
echo '<button Onclick="" style="border: none; background: none; color:green"><a title="Reenviar" data-toggle="tooltip"><i class="material-icons"></i></a></button>';
And I'd ike to change the icon's color. I tried to add the color to the button style; however it does not seem to work.
Upvotes: 7
Views: 44582
Reputation: 743
You should add style to i tag
<i style = "color:blue;" class="material-icons"></i>
also, you can create a css class
.blue {
color:blue
}
and then just add that class to a tag
<i class="material-icons blue"></i>
Upvotes: 11
Reputation: 637
You have to add the styling to the icon itself if you are using inline styling.
<i style="color: #ff0000" class="material-icons"></i>
Better yet you can use some some css to make this cleaner and more manageable and do something in css like this
.material-icons {
color: #ff0000;
}
Checkout the css w3 schools code examples https://www.w3schools.com/css/
Upvotes: 1