如何在CSS中将图标颜色更改为其他颜色?

时间:2016-08-30 06:38:11

标签: html css

我想通过CSS更改此图标颜色:

image

1 个答案:

答案 0 :(得分:-1)

这个怎么样?来自this site

<!DOCTYPE html>
<html>
<head>
<style>
img {
    width: 33%;
    height: auto;
    float: left;
    max-width: 235px;
    background-color: #12569a;
}


.blur {-webkit-filter: blur(4px);filter: blur(4px);}
.brightness {-webkit-filter: brightness(250%);filter: brightness(250%);}
.contrast {-webkit-filter: contrast(180%);filter: contrast(180%);}
.grayscale {-webkit-filter: grayscale(100%);filter: grayscale(100%);}
.huerotate {-webkit-filter: hue-rotate(180deg);filter: hue-rotate(180deg);}
.invert {-webkit-filter: invert(100%);filter: invert(100%);}
.opacity {-webkit-filter: opacity(50%);filter: opacity(50%);}
.saturate {-webkit-filter: saturate(7); filter: saturate(7);}
.sepia {-webkit-filter: sepia(100%);filter: sepia(100%);}
.shadow {-webkit-filter: drop-shadow(8px 8px 10px green);filter: drop-shadow(8px 8px 10px green);}
</style>
</head>
<body>

<p><strong>Note:</strong> The filter property is not supported in Internet Explorer, Edge 12, or Safari 5.1 and earlier.</p>

<img src="http://i.stack.imgur.com/W8L0k.png" alt="Pineapple" width="300" height="300">
<img class="blur a" src="http://i.stack.imgur.com/W8L0k.png" alt="Pineapple" width="300" height="300">
<img class="brightness a" src="http://i.stack.imgur.com/W8L0k.png" alt="Pineapple" width="300" height="300">
<img class="contrast a" src="http://i.stack.imgur.com/W8L0k.png" alt="Pineapple" width="300" height="300">
<img class="grayscale a" src="http://i.stack.imgur.com/W8L0k.png" alt="Pineapple" width="300" height="300">
<img class="huerotate a" src="http://i.stack.imgur.com/W8L0k.png" alt="Pineapple" width="300" height="300">
<img class="invert a" src="http://i.stack.imgur.com/W8L0k.png" alt="Pineapple" width="300" height="300">
<img class="opacity a" src="http://i.stack.imgur.com/W8L0k.png" alt="Pineapple" width="300" height="300">
<img class="saturate a" src="http://i.stack.imgur.com/W8L0k.png" alt="Pineapple" width="300" height="300">
<img class="sepia a" src="http://i.stack.imgur.com/W8L0k.png" alt="Pineapple" width="300" height="300">
<img class="shadow a" src="http://i.stack.imgur.com/W8L0k.png" alt="Pineapple" width="300" height="300">

</body

&GT;

enter image description here