The !important declaration

Let's see how the !important declaration works. We go back to this element selector in the CSS that's just a paragraph:

p {  font-size: 16px;  line-height: 1.6;  margin-bottom: 20px;}

We can go inside of the line-height value itself, then add !important to the end of that line. The line height will go up to 1.6:

p {  font-size: 16px;  line-height: 1.6 !important;  margin-bottom: 20px;}

Following is the output of preceding code:

Let's inspect this paragraph to make sure that it's actually using the !important declaration. As you can see in Chrome's DevTools, the inline style of 1 is being crossed out; we can see the ID ...

Get Mastering CSS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.