CSS class will not work due to some magic hidden digits

86 views Asked by At

I have a <div> with a class and want to assign a basic style to it. Somehow, my editor Atom seems to have messed up this code. I have copied and pasted

.my {
  background: yellow;
}

out of my editor, which does not work. Then I have added two other examples, which do work. The video below illustrates the problem:

https://vid.me/c2iB

While its easy to solve this, I got this problem in a second class, and I am interested, in how this error does occur. Does someone have an idea?

CODEPEN DEMO

2

There are 2 answers

1
Alexey Soshin On BEST ANSWER

The character you have after .my is not a space. It's a two bit character, with ASCII "194 160". Space is 032.

http://www.unit-conversion.info/texttools/ascii/

1
Loaf On

There is some hidden character here

.my {
   ^

If you delete the space and remake it, it fixes the issue.