Answer the question
In order to leave comments, you need to log in
After changing css via JavaScript hover doesn't work, what should I do?
Hello, I have an element like this
and there is css<div id="elem"></div>
#elem{
height: 100px;
width: 200px;
background-color: green;
}
#elem:hover{
background-color: blue;
}
Answer the question
In order to leave comments, you need to log in
If you want :hover to override your own styling, use !important in :hover .
For example:
#elem:hover{
background-color: blue !important;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question