CSS: Default Unit

By Xah Lee. Date: . Last updated: .

CSS doesn't have a default unit. Omitting unit is syntax error.

div.x {
 /* WRONG */
 width: 400;
}
div.x {
 /* correct */
 width: 400px;
}

But if it is 0, then no unit is necessary.