MacBook avec code sur un bureau

CSS – Making an attribute of one class more important than another

In order for one CSS attribute to take precedence over another, for example when an item is defined by two classes, it is possible to use the !important option.

For example:

<div class="style1 style2"></div>

CSS:

.style1 {
    background-color: #38c8ff;
}
.style2 {
    background-color: #ffffff !important;
}

The background will ultimately be white.