Q1: What are the core components of a CSS rule?

A CSS rule consists of a Selector (targeting the HTML DOM node) and a Declaration Block enclosed in curly braces {}. Inside the block, declarations are written as property: value; pairs separated by semicolons.

Anatomy of a CSS Rule
CSS Rule Structure
/* Selector { Property: Value; } */
h1 {
  color: #2965f1;
  font-size: 2rem;
}
💡 h1 targets heading tags, setting text color to hex #2965f1 and font size to 2rem.
Key Takeaways
  • Selector identifies the DOM element node.
  • Declaration block contains property and value pairs.
Knowledge Check

In the declaration font-size: 16px;, what is 'font-size' called?