I am facing an issue where I have a block and I want the background color to animate from bottom to top on hover. Can you please help me identify what is causing this problem? Your assistance is greatly appreciated.
.right-block--wrapper {
background: #fff none repeat scroll 0 0;
box-shadow: 0 0 5px 1px rgba(50, 50, 50, 0.75);
display: inline-block;
margin-left: -30px;
margin-top: 9px;
padding: 15px 19px 12px;
width: 100%;
max-width: 429px;
position: relative;
z-index: 2;
}
.right-block--wrapper:before {
background:#474747;
bottom: 0;
content: "";
left: 0;
position:
absolute;
right: 0;
top: 0;
transform:scaleY(0);
transform-origin: 50% 100%;
transition-duration: 0.3s;
transition-property: transform;
transition-timing-function: ease-out;
z-index: -1;
}
.right-block--wrapper:hover {
background: #474747;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="right-block--wrapper">
<p>Demo Content</p>
</div><!-- right-block--wrapper -->