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.
Using classes and IDs with compound selectors
- In this movie, we're just going to take another look at classes and IDs now that we've covered the most important selectors so we can see how these things can be used, specifically with compound selectors. Let's take a look at some HTML, and, depending on how conversant you are with HTML, you might at first think "I've broken the no spaces rule "in the class name attached to the div on line one", but this attribute is actually referring to two classes, one called smallprint and one named heavy, and here are the rules used in this entire block, just here. So, what happens to the contents of this div? Well, this is where we see some inheritance in action. Remember that unless any rule conflicts otherwise, then all paragraph text inside the div will inherit the properties of the parent. So, the text there will be 14 pixels, bold. You might also notice, if you try this out for real, that the heading size changes slightly, and, if you skip the movie on inheritance, you might want to…
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
-
-
-
-
-