Hey there! I'm dealing with a div that has a fixed height, but when hovered over, it expands by a specific amount.
I've also managed to make the background color change upon hovering over the div.
The issue arises when both the height and background color transition together. I want to disable the background color transition specifically. Currently, as the height changes, the background color fades from black to white. Is there a way to prevent this fading effect?
Here is the HTML:
<div class="box">
<p class="text">text text text</p>
<p class="content">text text text text</p>
</div>
CSS:
.box {
background-color: #000;
width: 200px;
height: 300px;
position: relative;
top: 80px;
-webkit-transition: all 0.25s ease;
-moz-transition: all 0.25s ease;
-ms-transition: all 0.25s ease;
-o-transition: all 0.25s ease;
transition: all 0.25s ease;
}
.box:hover {
height: 300px;
background-color: #fff;
top: 40px;
}