Imagine this …
@media screen and (min-width: 55.5em) {
aside[role="attend"] {
margin:0 !important;
}
}
@media screen and (min-width: 61.5em) {
aside[role="attend"] {
margin:0; /* still !important but shouldn't be */
}
}
Is there any way to overwrite or “remove” the !important declaration so it’s not still applied within the higher min-width value?
No; the way the cascade works, there is no way to undo an
!importantdeclaration or make it “unimportant”.This is regardless of whether the rule occurs within different
@mediarules or anywhere else in a stylesheet. That means it’s the same as though you didn’t have the media queries there to begin with:Which, incidentally, is what a browser actually sees if both the
min-width: 55.5emandmin-width: 61.5emmedia queries are fulfilled.You’re much better off finding a way to remove that
!importantand using a more specific selector in your first@mediarule instead.