I have this code:
html:
<div class="item">
<p>hello</p>
</div>
CSS:
.item {
border: 2px dashed green;
background-color: red;
width: 100px;
height: 100px;
margin-left: 30px;
margin-top: 30px;
}
.item :hover {
background-color: yellow;
}
I'm trying to change all of the item's color to the yellow on hover. However, only the text's background color changes:
while I want this:
Fiddle: https://jsfiddle.net/87qd0au9/