How to make a logo to hover change color?

The crux of the matter is that I have the logo changes color when you hover.
But when I try to make him a top margin, the logo indents with the background.
How to fix it?
I have here what is written
<a href="#" class="logo2"></a>

.logo2{
 background:url(loggg.png) no-repeat;
 width: 117px;
 height: 43px;
 margin-top: 35px;
 z-index: 8;
}
.logo2:hover{
 background: url(logg.png) no-repeat;
}
March 20th 20 at 11:20
2 answers
March 20th 20 at 11:22
Solution
And logo you is that ? image or some text ?
image - Easton.Schaden41 commented on March 20th 20 at 11:25
@Kaleigh_Williamson, you want to have the image change color when you hover , right ? - Kailey_Beat commented on March 20th 20 at 11:28
@heather38, Yes, the color I already managed to change, but with the indentation problem. - Easton.Schaden41 commented on March 20th 20 at 11:31
@Kaleigh_Williamson, img you have display: block ?? - Kailey_Beat commented on March 20th 20 at 11:34
@heather38, Yes - Easton.Schaden41 commented on March 20th 20 at 11:37
@Kaleigh_Williamson, and that in your case the background: url ? - Kailey_Beat commented on March 20th 20 at 11:40
@Kaleigh_Williamson, by the way, z-index does not work for you ..as it works only with a position - Kailey_Beat commented on March 20th 20 at 11:43
@heather38, well, the first url is supposedly a grey logo, and the second url is already white logo - Easton.Schaden41 commented on March 20th 20 at 11:46
@Kaleigh_Williamson, I don't understand it , you have the logo's background ?or just <a href=""><img src=""></a>? - Kailey_Beat commented on March 20th 20 at 11:49
@heather38, background - Easton.Schaden41 commented on March 20th 20 at 11:52
@Kaleigh_Williamson, so I asked for this,show a screenshot of what predstavljaet right now is - Kailey_Beat commented on March 20th 20 at 11:55
5cc961e478d60316964715.jpeg - Easton.Schaden41 commented on March 20th 20 at 11:58
@Kaleigh_Williamson, well logo can be converted into (say SVG) then many of the tricks you will ...
the indentation on the top of make padding-top : this block holds your logo ..you know ?? - Kailey_Beat commented on March 20th 20 at 12:01
all, I got what you said about position)
so I blunt pancake))
thank you for your help - Easton.Schaden41 commented on March 20th 20 at 12:04
March 20th 20 at 11:24
use svg, and will not have all these crutches

Find more questions by tags CSSHTMLLayout