Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference in having a space in between px?

Tags:

css

What is the difference between:

border-right: 1px dotted #CCCCCC;

and:

border-right: 1 px dotted #CCCCCC;

Is there any?

Is the second incorrect? Do you need to have the number right next to px?

like image 660
jackcogdill Avatar asked Dec 08 '22 18:12

jackcogdill


1 Answers

"The format of a length value (denoted by <length> in this specification) is a <number> (with or without a decimal point) immediately followed by a unit identifier (e.g., px, em, etc.). After a zero length, the unit identifier is optional."

Source: http://www.w3.org/TR/CSS21/syndata.html#length-units

In other words: having a space before the "px" is a syntactical mistake. Have you validated your CSS?

like image 98
Phrogz Avatar answered Dec 11 '22 12:12

Phrogz