From the course: EPUB: CSS

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Understanding the concept of inheritance

Understanding the concept of inheritance - InDesign Tutorial

From the course: EPUB: CSS

Start my 1-month free trial

Understanding the concept of inheritance

- You hear quite a lot in and around CSS, about something called Inheritance. An inheritance as it's described here from the W3 specification, propagates property values from parent elements to their children. Okay, pretty dry, but if you have ever heard a phrase such as, "Oh, you've got your mother's eyes, "or your father's nose", or one of those things, then you know exactly what inheritance is. It's some of the characteristics of a parent passed down to children. And HTML and CSS are very much like that. If, for example, I had a block of code like this, I've got a body tag, an h1, a p, and then a div element, and an h1 and another p in there, closing the div off, closing off the body, and then wrote this rule, body font size 16 pixels, then that would be inherited by all of the children, just there. Some of them like the h1 element, would modify based on those properties, so h1s for example, are ordinarily going to be twice as big as paragraph text. So, if that was ordinarily 16…

Contents