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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.