</>
ValidateHTML

Missing Colon in CSS Declaration

Every CSS declaration uses a colon to separate the property from its value: 'color: red'. Forgetting the colon makes the browser interpret the entire line as a malformed property name, breaking the declaration and potentially the next one too.

Why It Matters

A missing colon breaks the current declaration and may cause the parser to misinterpret the next line as well, similar to a missing semicolon.

Code Examples

Bad CSS
.title {
  color red;            /* missing colon */
  font-size 24px;       /* missing colon */
  margin-bottom 20px;   /* missing colon */
}
Good CSS
.title {
  color: red;
  font-size: 24px;
  margin-bottom: 20px;
}

How to Fix

  • 1Every CSS declaration follows the pattern: property: value;
  • 2If a property isn't applying, check that the colon is present between property and value.
  • 3This error is common when copying values from design tools that use different syntax.
  • 4A CSS validator catches missing colons on the exact line.

Check Your CSS Now

Our CSS validator detects this error automatically and shows the exact line number.

Open CSS Validator
Recommended

Hostinger Fast & Affordable Web Hosting

Deploy clean, validated CSS on reliable hosting.

Get 80% Off Hosting →

Related CSS Errors

View all CSS errors