I am implementing a close button on an element containing text with CSS. The close button is generated content from a pseudo element with content:\'X\';
. I need
I believe that it's not working in pseudo elements in IE,
What I'm use to do is add cursor: ponter
to main element.
If you need to add cursor: pointer
to pseudo element only, than only way is to add child element
like:
some text
div{
font-size:2em;
position:relative;
display:inline-block;
}
div > span{
cursor:pointer;
}
div > span::before{
content:'X';
display:block;
text-align:right;
}
But than is no point to using pseudo class...
demo