Fix background for div on hover
Hey guys,
You can see in screenshot when I hover on a card the background is getting disturbed. I need it to have same style background (dark one like other two) before and after hover, can any one help me
Thank you.
https://codepen.io/Moksha-Nirugutti/pen/QWPOOvM
5 Replies
the transform on the
.card:hover
is creating a new stacking context that prevents deeper layers (the peudos') to go behind it.
What you can do is add
btw, you don't need to have 2 pseudos. for the gradient border you could use a background gradient clipped to the border-box on the main element
that way the border-radius would be more exact
https://codepen.io/MarkBoots/pen/MWROQPm
this is very pretty 🙂
@MarkBoots thanks Mark