0

One of my div's names is "N/A (nationwide)", and I have an scss file for css properties. How would I apply css to this div?

neither

 .N/A{

}

.(nationwide){

}

seem to work.

Cœur
  • 34,719
  • 24
  • 185
  • 251
csiscs
  • 59
  • 1
  • 9

2 Answers2

0

You need to escape the / character with a backslash, like this:

.N\/A{
    ...
}
posit labs
  • 8,410
  • 4
  • 35
  • 59
0

There are other questions about the allowed characters in class names, and you can also check the Grammar on W3 that / isn't an allowed character in class names.

I'm not aware of any Sass rule that allows it.

Dinei
  • 3,350
  • 3
  • 30
  • 54