Reputation: 9314
Is it possible to only display the :after
pseudo using :hover
? For example using alternative elements.
#parent{}
#child{display:none;}
#parent:hover >#child{display:block;}
As far as I've got with the same method:
#parent{}
#parent:after{content:'hi';display:none;}
#parent:hover #parent:after{display:block;}
Is it possible at all? Or am I fooling myself?
Upvotes: 7
Views: 219
Reputation: 128791
You can combine the two:
#parent:hover:after {
content:'hi';
}
Upvotes: 6
Reputation: 70728
Yes. Not sure why you didn't try it yourself but it's possible:
#parent:hover:after{content:'hi';}
Upvotes: 5