<style>
    #myid {
        background-color: red;
    }
    .important-background {
        background-color: yellowgreen !important; /* !important declaration */
    }
</style>
<p id="myid" class="important-background">
    CSS !important Usage – Overriding Style Priority
</p>
Rendered Output
.important-background {
    background-color: yellowgreen !important; /* This background color must not be changed. */
}
<style>
    #myid {  /* specificity = 0,1,0,0 */
        background-color: red !important;
    }
    .important-background {  /* specificity = 0,0,1,0 */
        background-color: yellowgreen !important;
    }
</style>

<p id="myid" class="important-background">
    CSS !important Usage – Overriding Style Priority
</p>
Rendered Output
<style>
    .important-background {
        animation: bg-animation 3s infinite both;
    }
    @keyframes bg-animation {
        0% {
            background-color: red !important;
        }
        100% {
            background-color: yellowgreen;
        }
    }
</style>

<p class="important-background">
    CSS !important Usage – Overriding Style Priority
</p>
Rendered Output
<style>
    .important-background {
        border: 2px solid red !important;
    }
    .important-background:hover {
        border-color: blue; /* Cannot override the !important declaration */
    }
</style>

<p class="important-background">
    CSS !important Usage – Overriding Style Priority
</p>
Rendered Output Hover over the element.
The border-color: blue; declaration is not applied.
<style>
    .important-background {
        /* border: 2px solid red !important; */
        border-width: 2px !important;
        border-style: solid !important;
        border-color: red !important;
    }
    .important-background:hover {
        border-color: blue; /* does not override */
    }

</style>
<p class="important-background">
    CSS !important Usage – Overriding Style Priority
</p>