Question

I've seen this notation used a lot, and I was wondering, is there is any notable difference between these two notations?

element#id
{
  property: 0.5px;
}

and

element#id
{
  property: .5px;
}

I use property: .5px; all the time, as I find it cleaner looking.

Does anyone know which one is better or correct? I didn't find this situation in the w3 specification.

Thanks!

Was it helpful?

Solution

Both are correct. This is stated in section 4.3.1. Specifically:

A <number> can either be an <integer>, or it can be zero or more digits followed by a dot (.) followed by one or more digits.

The only difference between them is a 0 character; whether you choose to include the leading 0 is entirely up to individual preference.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top