Selectors, Properties, and Colors

Updated in 19th of June 2025

Programming or Coding


1. Selectors — Who are we styling?

Selectors tell CSS what HTML element you want to style.

In the example above:

  • h1 is the selector (we’re styling the <h1> tag)

Try - What will this style affect?

Answer - All <p> (paragraph) tags.



2. Properties — What are we changing?

Properties are the style rules. They describe what you want to change.

Examples:

  • color: text color
  • font-size: size of text
  • background-color: background shade
  • border: adds a border

Question - What property would you use to center text?
Answer - text-align: center;

3. CSS Values — The “How” of Styling

Values tell CSS how to apply a property.

Property = What you`re changing
Value = How you want it changed

Example:

  • font-size is the property
  • 20px is the value

Common Value Types:






4. Colors (Add the vibe)

In CSS, you can style colors using:

  • Color names (Easy to Remember): red, blue, orange
  • Hex codes (Web Standard Colors): #FF5733, #000000, #FFFFFF
  • RGB values (More Control): rgb(255, 0, 0) = red



Final Recap:


Watch this video for a deeper understanding of CSS Colors



OTHER CONTENTS