I have already checked the questions on this, but I have found no solution to my problem.
The question I have is, I have to add a hover effect in the media request and I've already done it and but it doesn't work properly.
I tried changing the values of the z-index
, but it doesn't work.
body{
overflow: hidden;
margin: 0;
padding: 0;
}
.container{
width: 100vw;
height: 100vh;
background: linear-gradient(to right, #ade76d, #5f49bb);
}
.text-container{
height: 90vh;
display: flex;
align-items:center;
justify-content: space-around;
}
#color-code{
color: white;
font-size: 1.2rem;
}
#click{
background: none;
padding: 1rem;
border: none;
color: white;
outline: none;
}
#click:hover{
cursor: pointer;
}
#click:active{
animation: rotation 200ms linear;
}
#pressSpace{
display: none;
}
#tooltip{
visibility: hidden;
}
/* .rotate{
animation: rotation 2s linear;
} */
@keyframes rotation {
from{
transform: rotate(0deg);
}to{
transform: rotate(90deg);
}
}
/* Responsive properties */
@media only screen and (min-width:740px) {
.text-container{
justify-content: center;
}
#color-code{
font-size: 2rem;
}
#tooltip{
position: absolute;
top: 240px;
left: 340px;
color: white;
background: black;
padding: 0.4rem;
border-radius: 0.3rem;
}
#color-code:hover #tooltip{
visibility: visible;
z-index:200
}
}
@media (min-width: 992px) {
#pressSpace{
display: block;
color: white;
}
}
<div class="container" id="container">
<div class="text-container">
<div id="color-code" >
linear-gradient(to right, #ade76d, #5f49bb)
</div>
<button id="click"><i class="fas fa-sync fa-lg"></i></button>
</div>
<div id="tooltip">
Click to Copy
</div>
</div>
<script src="script.js"></script>
</body>