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
- 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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
What is CSS?4m 30s
-
Understanding the relationship between CSS and EPUB57s
-
Understanding the concept of inheritance2m 59s
-
Taking a look at the basic anatomy of a CSS rule3m 42s
-
Working with three basic CSS selectors4m 23s
-
Working with more advanced compound selectors3m 9s
-
Targeting elements with group selectors1m 43s
-
Understanding descendant selectors3m 48s
-
Using classes and IDs with compound selectors2m 57s
-
Discovering how Cascading Style Sheets are implemented6m 22s
-
Incorporating @ directives in CSS1m 52s
-
Understanding fixed and relative units6m 57s
-
Understanding the CSS box model3m 32s
-
Including comments inside CSS2m 47s
-
Writing more efficient code with shorthand notation3m 53s
-
-
-
-
-