Yuval Pruss
Yuval Pruss

Reputation: 9846

CSS convention for rgb colors

Is there any convention for css rgb color values? I mean- sholud the values be separated with spaces or should they not?

For example- should it look like this:

.some_element_class {
    color: rgb(100,100,100);
}

Or like this?:

.some_element_class {
    color: rgb(100, 100, 100);
}

Upvotes: 0

Views: 217

Answers (2)

T04435
T04435

Reputation: 14002

As the W3 org, it can be used with and without spaces.

My advice is for you to use the one you like better and follow that in all your projects. If you get to work for a company follow their code formatting.

Upvotes: 2

Thomas Ray
Thomas Ray

Reputation: 103

I think the first one is superior because it uses less symbols and the readability is the same. But the most important thing is to be consistent.

Upvotes: 1

Related Questions