Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS Transitions and Transforms Getting Started with CSS Transitions Transitioning Specific Properties with transition-property

Audra Ogilvy
Audra Ogilvy
3,142 Points

Rule Definition

In a previous Treehouse tutorial, an instructor said that a rule was one block, like all the values and properties that were within one set of curly braces. Here Guil uses the term "CSS rule" to describe the block of three "rules". I've googled this and am still seeing that a rule should have just one set of curly braces. Is Guil using the term "rule" to apply to all three rules just because there isn't a better word for the block of three? I was trying to explain this transitions thing to someone else, and got caught up on the nomenclature. How do you explain why all the properties in .button:hover apply to the transition-duration property in .button? Is it because they are all part of the CLASS ".button"? or what makes all three of these rules ONE rule?

1 Answer

Steven Parker
Steven Parker
231,268 Points

I believe the word "rule" is used to speak generically, not to refer specifically to any one (or all 3) of the rules in the example. The example shows 3 different (but related) rules.

And when the mouse is over the button, the properties in the ".button:hover" rule override those of the same name in the ".button" rule, but the transition-duration remains in effect since it is not one of those overridden.