There are png-icons, for example, from VC, blue. How to use css to change it to white?
PS: google about filter: hue-rotate() , but with white color this is not an option.
<img src="https://vk.com/images/icons/head_icons.png"> You can use css-filters:
Note: filters can be combined with each other.
.bg{ background-color: #8fbd35; padding: 20px; } .fl{ filter: invert(1); } <div class="bg"> <img src="https://vk.com/images/icons/head_icons.png"> </div> <div class="bg"> <img class="fl" src="https://vk.com/images/icons/head_icons.png"> </div> Reading material : habrahabr
Demo: demo
If the background is transparent, then you can unscrew the picture brightness . For example:
filter: brightness(10); But there remains some uncertainty about the level to which to twist, so that all shades, except for white, probably disappear. But brightness(0) will give a completely black picture that is easy to invert :
filter: brightness(0) invert(1); http://codepen.io/glebkema/pen/dNKGXZ
body { background: #ccc; } img { display: block; } <img alt="" src="//i.stack.imgur.com/R8YjS.png"> <img alt="" src="//i.stack.imgur.com/R8YjS.png" style="filter: brightness(5);"> <img alt="" src="//i.stack.imgur.com/R8YjS.png" style="filter: brightness(10);"> <img alt="" src="//i.stack.imgur.com/R8YjS.png" style="filter: brightness(0) invert(1);"> Example of changing colors to CSS:
@keyframes hue { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(-360deg); } } .hue { animation: hue 10s infinite linear; } <img class="hue" src="https://vk.com/images/icons/head_icons.png"> Source: https://ru.stackoverflow.com/questions/623316/
All Articles