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
.title {
color red; /* missing colon */
font-size 24px; /* missing colon */
margin-bottom 20px; /* missing colon */
}.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 ValidatorHostinger — Fast & Affordable Web Hosting
Deploy clean, validated CSS on reliable hosting.
Related CSS Errors
Missing Semicolon in CSS
Why missing semicolons break CSS rules and how to find them. The most common CSS syntax error.
Invalid CSS Property Value
Learn why CSS property values are invalid and how to fix them. Common mistakes with colors, units, and keywords.
Unknown CSS Property
How to fix unknown or misspelled CSS property names. Common typos and non-standard properties.