Updated to make it a little better.
As per your request from the comment, this is a workaround to use :afteror :beforefor your div.
div {
display: block;
width: 500px;
height: 200px;
border: 1px solid black;
border-radius: 5px;
transition: box-shadow 1s;
position: relative;
background: #fff;
}
div:after {
content: '';
display: block;
position: absolute;
width: 500px;
height: 200px;
border-radius: 5px;
background: #000;
left: 0;
top: 0;
opacity: 0;
transition: all 1s ease-in-out;
z-index: -1;
}
div:hover:after {
left: 25px;
top: 25px;
opacity: 1;
}
<div>Test</div>
Run codeHide resultjsfiddle
This works fine in IE 11.
source
share