Special characters in the CSS selector

I found this CSS definition in a semantic interface . They make extensive use of this style.

.ui.\32.buttons > .button,
.ui.two.buttons > .button {
  width: 50%;
}

I see what they are trying to accomplish. They want the CSS definition to be read.

.ui.2.buttons > .button,

This must be an ASCII code. Code \ 32 will be space. Code \ 3 will be the beginning of the text.

Can you explain what is going on here? Why does ascii not turn into space? And why does the W3C CSS validator accept this CSS without errors?

+4
source share
1 answer

\32- hexadecimal 32, which is converted to the decimal number 50, which is really a character 2. \31will be 1.

I found this quote from the W3C specs:

CSS2 ( , ) [A-Za-z0-9] ISO 10646 161 (-); . ISO 10646 (. ). , "B & W?" "B\& W \?" "B\26 W\3F".

, , , , , ( ) ISO 10646 .

+2

All Articles