I wanted to ask if there is a way I can add color to the icon I linked down below if I hover over it?
For example how can I make the color only of the text "in" red if I hover over it? I think you have to do it in combination with a photo editor but I dont really know how. Thanks for help
This is my code I tried.
<section id="icons">
<a href="#"><img src="youtube.png" class="youtube" alt=""></a>
</section>
.youtube {
background-image: url(youtube.png);
width: 5vw;
position: absolute;
}
.youtube:hover {
background-image: url(youtubehover.png);
width: 5vw;
position: absolute;
}
Here's a quick example: https://jsfiddle.net/oowjwLru/
This can be easily accomplish by placing a colored div behind the image, and then using the following simple jQuery to automatically hide the div and show it when the mouse is over:
Html:
Javascript/jQuery:
You can use a svg (no problems with resizing) and change the fill color at hover
Html:
Css:
In the svg the path must have the id "linkedin" to change color
The best way to do this is to create two seperate images. One for when the icon is in its default state, and the other for when it is in its hover state. In the hover state, change the color to whatever you like, in your case red, so that when the user puts their mouse over it, they see that color.
Here is an example of some CSS to do this:
:hover changes what the image will look like when the user hovers over the icon. Notice the background images are different, one for each state the icon could be in. I also added "cursor: pointer" assuming this icon will be a button of some sort.
I had to make the text inside the icon blank using magic wand with paint.net. I Also deleted the white color of the edges. With the following code I changed the color from the text or the content inside the icon from white to red when I hover over it
Since the image is black and white, you can use this.