Force Change CSS Attribute Values (FCCAV)


FCCAV:    SOLD




Hi guys, has anyone experienced back and forth modifying CSS styles but the results are the same? Why is there no change? Okay, on this occasion I will share a similar experience. I used to be a newbie too, even now I still am, the only difference is the level of seniority, hahaha. Okay, enough.

Let's say I'm building a web template, of course nowadays I don't start from scratch, I use bootstrap as my web style framework. Then there are some css style attributes that I have to adjust to my taste.

Not only that, I also had to modify some styles that were written inline inside the opening tag of the element.

So to do all that, we just need to use something called !important

Adding !important will force duplicate attributes into one rule or one value.

To make it clearer, let's start with a simple case like the following.

HTML

<div style="font-size: 18px; color: red;">
    Hello World, How Can I Change The Color To Blue?
</div>

CSS

div {
   color: blue;
   /* This Isn't Working */
}

SOLUTION

div {
   color: blue !important;
   /* Good job it work! */
}

Okay, besides inline styling manipulation, this can also be used to manipulate external styles like bootstrap.


Post a Comment

Previous Next

نموذج الاتصال