How can i use hover effect on after element with css? -


this question has answer here:

this code, want show hover effect on after element.

 #car:after:hover{background:red:} 

but not working.

check out demo below. think missing content property.

the red div created using :after , changes color on hover.

the selector:after:hover won't work.

.car {    position: relative;    width: 100px;    height: 100px;    background: yellow;  }    .car:hover {    background: skyblue;  }    .car:after {    content: '';    width: 50px;    height: 50px;    position: absolute;    right: 0;    bottom: 0;    background: green;  }    .car:hover:after {    background: red;  }
<div class="car"></div>


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -