Goal:
Create a simple text-box element with remove icon with css3
only.
The icon should change his color to blue
on hover
.
Progress:
It's pretty easy to achieve my wish with a little html and css code.
.ui-textbox {
padding: 0 10px 0 0;
position: relative;
}
.ui-textbox span {
margin: 0 10px;
}
.ui-textbox:hover:after {
content:"x";
position: absolute;
top: 0;
font-size: 16px;
right: 20px;
}
<label class="ui-textbox">
<span>Some label</span>
<input type="text" />
</label>
My Problem:
Can't find out how to catch the hover event on the after element so I could change his color.
Something like:
.ui-textbox:hover:after:hover {
color: blue;
}