This is an odd thing to specify, and I never saw a practical use case in the wild. This declaration tells the div to use the margin specified on its parent, however. In fact, you most likely don’t want that. The fact that an element has margin-left: 10% does not mean all of its descendents should also get that margin. Normally margins don’t inherit, and for good reason. But if you remove the colour difference between links and main text, make sure your links are underlined. Here, however, we explicitly tell the browsers that the link colour should be inherited from its parent, the div. As a CSS programmer you frequently set it, and even if you don’t browsers automatically make it blue for you. It’s not specified here, but because color is inherited by default the div gets the text color of its parent.
It says that the link colour in the div should be the same as the text colour. The second declaration is easiest to explain, and sometimes actually useful. The inherit keyword explicitly tells an element that it inherits the value for this declaration from its parent. [ Would you like to improve your CSS? You can hire me as a Despite 4 still being in draft revert is already supported. The first three were defined in the Cascading Level 3 spec, while revert was added in Cascading Level 4. Also, we will ask where and when to use them to the greatest effect, and if we need more of those keywords. Today we’re going to take a quick look at a few special CSS keywords you can use on any CSS property: inherit, initial, revert, and unset. Sitemap contact Inherit, initial, unset, revert