1
.csgo-player {
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.csgo-player-link {
width: 40%;
position: relative;
}
.csgo-player-info {
padding: 10px;
height: 200px;
width: 100%;
background-color: green;
position: absolute;
display: none;
}
.csgo-player-link:hover .csgo-player-info {
display: block;
position: absolute;
z-index: -1;
}
<li class="csgo-player">
<a href="#" class="csgo-player-link">
<img src="https://www.w3schools.com/images/w3schools_green.jpg" alt="">
<div class="csgo-player-info">
<header class="csgo-player-header">
<h2 class="csgo-player-header__title">arT</h2>
<span>Andrei Piovezan - IGL</span>
</header>
<div class="csgo-player-socials">
<ul class="csgo-player-social-list">
<li class="csgo-player-social-item"></li>
<li class="csgo-player-social-item"></li>
<li class="csgo-player-social-item"></li>
</ul>
<a href="#" class="csgo-player-download">Download CFG
<i class="csgo-player-download__arrow"></i>
</a>
</div>
</div>
</a>
</li>
I want that when I give one Hover in the .csgo-player-link
, the .csgo-player-info
appear... someone can help me?
In the example you posted by Jsfiddle, by replacing all
div.cp-thumb
by anchorsa.cp-thumb
will work normally, which shows that its premise, that with<a>
does not work is mistaken.– Woss
Thanks for the example! I switched the sample code of the question and it worked. In this specific scenario it did not work with and with div yes. I didn’t study deep why the difference.
– Leonardo Negrão
If you could please try to make it work with <a> my code that is working with <div> in the answer, I would be glad to understand.
– Leonardo Negrão
Leonardo, I put the explanation in response
– Woss