Lesson: Understanding CSS Properties

Objective: By the end of this lesson, you’ll understand what CSS properties are and how they are used to style HTML elements.


What are CSS Properties?

CSS properties are the parts of a CSS rule that define the style of an element. Each property controls a specific aspect of an element’s appearance, such as its color, size, positioning, and spacing.

CSS Rule Structure

Every CSS rule has three main parts: Selector: Targets the HTML element. Property: The style aspect to be changed. Value: The specific setting for the property.

Here’s an example:

p {
  color: blue;
  font-size: 16px;
}

Commonly Used CSS Properties


Using Multiple Properties

CSS rules can have multiple properties, allowing you to apply several styles to the same element.

button {
  background-color: green;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
}

This CSS rule:


There are so many CSS properties. One of the best resources to learn about all of the properties is w3Schools.com CSS Property Reference.