For mobile, I utilized the :hover and :active pseudo-classes to create a transition effect when tapping on a tab that enlarges the elements for more information. However, I am seeking a way for the activated element to return to its original state after a certain period of time has passed. I have not been able to find a similar query.
Edit: It seems that the element remains in a "hovered" state permanently. I would like it to stop being hovered after a few seconds.
Edit2: http://jsfiddle.net/qw8vyrxd/
.box {
width: 40px;
height: 40px;
background-color: red;
}
@media screen and (max-width: 1000px){
.box:hover, .box:active{
width: 60px;
height: 60px;
}
}
On mobile devices, clicking on the red square causes it to expand due to the hover selector, but it does not shrink back unless the page is reloaded. I am looking for a solution where the hover effect only lasts for a couple of seconds.
Thank you