CSS value inherit, property:inherit

The CSS value inherit can be used for every property. It allows you to reinisialize the CSS value to the selected property to it’s default value. For example if you use:
ul{ list-style:none }

to take off all the bullets point from your list you could use

ul.justHere{ list-style:square }

However that will set up the bullet point to be square (yes I now it’s obvious). But you might want to live the style of the bullet points down to the navigator. In this case “inherit” is the solution:

ul.justHere{ list-style:inherit }

I find it very usefull when I use a CSS reset that take off everything so I can, in some occasion bring the defaultstyle back.

Leave a reply