Is it possible to change the color of an image using only CSS?
(I'm using the transparent backgrounded glyphicons, and I need different symbol [not background] colors for my theme)
Is it possible to change the color of an image using only CSS?
(I'm using the transparent backgrounded glyphicons, and I need different symbol [not background] colors for my theme)
You can use image tints, but I don't know if it's going to give you the effect you expect:
Basically you wrap a <figure> element around your <img/> and apply styling to it:
/*HTML*/
<figure class="tint">
<img src="icon.png" width="400" height="260">
</figure>
/*CSS*/
.tint {
position: relative;
float: left;
cursor: pointer;
}
.tint:before {
content: "";
display: block;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0,255,255, 0.5);
-moz-transition: background .3s linear;
-webkit-transition: background .3s linear;
-ms-transition: background .3s linear;
-o-transition: background .3s linear;
transition: background .3s linear;
}
.tint:hover:before {
background: none;
}
Check the link for a demo and full code samples.
On this website you can also check out some different methods.
<img/> tags. Otherwise, if it's a background in CSS, I don't know how to change it.style="background-color: red" to the parent tag).No. As these are image icons you can not change their color. You can try using these http://www.entypo.com/. As these are fonts they can easily change colors.