Do not use !important, because this is the worst solution, if you want to switch the style, do so.
#idname{
border: 2px solid black;
}
#idname.classname {
border: 2px solid gray;
}
<div id = "idname" class="classname">it is a test</div>
Run codeIf you want to customize other elements with a class classname, and not just #idnameuse:
#idname.classname, .classname {
border: 2px solid gray;
}
source
share