Errol Chaves Moya
Errol Chaves Moya

Reputation: 377

Change Bootstrap icon color

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">&#xE0BE;</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

Answers (2)

keizah7
keizah7

Reputation: 743

You should add style to i tag

<i style = "color:blue;" class="material-icons">&#xE0BE;</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">&#xE0BE;</i>

Upvotes: 11

A Star
A Star

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">&#xE0BE;</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

Related Questions