Skip to main content

What are property and value in CSS?

In CSS, property is the characteristic you want to change on an element, and value is the specific setting you assign to that property.

Example:

css
p { color: red; }

Breakdown:

PartWhat it is
colorproperty (defines what exactly we're changing)
redvalue (sets what the color will be)

Another example:

css
p { font-size: 18px; background-color: yellow; }

Here:

PropertyValue
font-size18px
background-coloryellow

In short: property is "what we change", value is "what we change it to".

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.