🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Expert Masterclasses.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
REFERENCEcss

css Documentation

LOADING ENGINE...

CSS Properties

The building blocks of style. Learn how properties and values work together to design the web.

style.css
h1 {
color: blue;
font-size: 2rem;
}

Hello World

style.css
1 / 9
🎨

Tutor:CSS controls how HTML elements look. To style an element, we use a CSS Rule. A rule starts with a Selector, pointing to the HTML element we want to style.


CSS Mastery

Unlock nodes by learning syntax, properties, and values.

Concept 1: Properties

A property is an identifier that indicates which stylistic feature you want to change (e.g., font-size, width, color).

System Check

What does a CSS property define?


Community Holo-Net

Share Snippets

Created a cool button style? Share your CSS properties and values.

Enjoying this guide?

Codesyllabus is 100% free and open-source. Support our mission, pay for server infrastructure, and fuel new tutorials by buying us a coffee!

CSS Properties and Values

Author

Pascual Vila

Frontend Instructor.

CSS (Cascading Style Sheets) relies on a simple yet powerful syntax: the property and the value. Together, they form a declaration that tells the browser how to render an element.

The Anatomy of a Declaration

A CSS declaration consists of a property name, followed by a colon (:), a value, and a semicolon (;).

property: value;

Common Properties

  • color: Sets the text color.
  • font-size: Determines the size of the text.
  • background-color: Sets the background color of the element.
  • margin: Creates space around elements.

Values

Values depend on the property. color takes color names or codes (like hex or rgb). font-size takes length units like px, em, or rem.

Best Practices

Always end your declarations with a semicolon. While the last declaration in a block technically doesn't require one, omitting it is a common source of errors when you add more properties later.

CSS Glossary

Property
The aspect of the element you want to style (e.g., color, width).
Value
The setting for the property (e.g., red, 20px).
Declaration
The combination of a property and a value, separated by a colon.
Rule Set
A selector plus a declaration block (the code inside the curly braces).