@R3ygoski
Posted
Hello Carolina, congratulations on completing your project! It turned out very well.
Regarding your question, yes, you can simulate the :hover
effect without using pseudo-elements or pseudo-classes, but I must warn you that it’s not a practical approach. You could do something like this in a JavaScript file, for example:
block.addEventListener('mouseover', () => {
block.style.display = 'block'
})
block.addEventListener('mouseout', () => {
block.style.display = 'none'
})
However, this may add an extra layer of complexity to your project. Personally, I recommend sticking to the use of the hover
pseudo-element.
And again, congrats, if you have any further questions or doubts, feel free to ask, and I’ll do my best to assist!
Marked as helpful
@CarolinaCiolin
Posted
Hey, thank you very much for your comment :)
I'll be learning JavaScript soon, so I'll come back to this project to try it out the way you suggested.