Great work! You've learned the basics of CSS structure and syntax. We'll continue to build on these basics as you learn more about CSS.
Let's review what you've learned so far:
1. A CSS selector targets an HTML element.
2. CSS declarations style HTML elements. Declarations must contain the following two things:
- property - the property you want to style.
- value - the value for the property you are styling.
3. CSS declarations must end in a semicolon (
4. A CSS rule consists of a CSS selector and the declarations inside of the selector.
5. Multiple element selectors can be used to style multiple elements at once.
6. Comments keep code easy to read and allow you to experiment with new code without having to remove old code.
7. CSS follows certain best practices for spacing and indentation:
- One line of spacing between a selector and the opening curly brace.
- No spacing between CSS declarations and the opening and closing curly braces of the CSS rule.
- Two spaces of indentation for CSS declarations.
- One line of spacing between CSS rules.