What does !important
mean in VueJS?
I am new to vue.js and I am seeing this piece of code included after values in style sheets.
I can't find it in the docs.
What does !important
mean in VueJS?
I am new to vue.js and I am seeing this piece of code included after values in style sheets.
I can't find it in the docs.
!important
is used in CSS to make sure that style overrides any competing styles.
lets say I have a button .btn
and it was in a container called .btn-container
if I had css this css
.btn {
color: red !important;
}
.btn-container .btn {
color: blue;
}
the .btn
color would still be red even though the nested rule is higher in specificity. Once you add the !important it overrides the specificity.
https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity#The_!important_exception