What's CSS's Default Unit?

By Xah Lee. Date:

CSS doesn't have a default unit. For example, you cannot write:

div.x {width:400}

you have to write:

div.x {width:400px}

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

List of CSS Units

See: CSS: Units.

Like what you read? Buy JavaScript in Depth
or, buy a new keyboard, see Keyboard Reviews.