devxlogo

Learn How to Force a Style

Learn How to Force a Style

If a style is marked with !important, it will be used with priority even if there’s a overwriting rule below it.

.page { background-color:green !important; background-color:blue;}

In the example above, background-color:green will be adopted because it’s marked with !important, even if there’s a background-color:blue; below it. !important is used in situation where you want to force a style and prevent something else from overwriting it.

devx-admin

Share the Post: