0

I have set the transition CSS property for a hover effect but for some reason it isn't working.

HTML-

<div class = "menuItemBox" id = "Mughlai">
    <p class = "menuItemHeading">Mughlai</p> 
</div>

CSS-

.menuItemBox {
    border-style: solid;
    border-width: 5px;
    border-color: DC3D00;
    margin: 10px;
    width: 33%;
    height: 180px;
    background-size: cover;
}

#Mughlai {
    background-image: none;
    transition: 0.3s;
}

#Mughlai:hover {
    background-image: url("./images/Mughlai.jpg");
}

1 Answers1

0

Add hover to #Mughlai.

.menuItemBox {
    border-style: solid;
    border-width: 5px;
    border-color: DC3D00;
    margin: 10px;
    width: 33%;
    height: 180px;
    background-size: cover;
   transition: 0.3s;
}

#Mughlai:hover {
    background-image: none;
    transition: 0.3s;
   border-color: #ccc;
}
<div class = "menuItemBox" id = "Mughlai">
    <p class = "menuItemHeading">Mughlai</p> 
</div>
Vishal
  • 235
  • 1
  • 15