A
A
Alexander Nameless082017-07-20 12:39:54
css
Alexander Nameless08, 2017-07-20 12:39:54

_ at the beginning of the class name?

Hello!
Class names can only consist of Latin characters (az, AZ), numbers (0-9), hyphens (-), and underscores (_). Moreover, class names must begin with a Latin character, and not with a hyphen or a number. "- although nothing was said about the underscore.
However, I noticed that class names begin with an underscore. I also tried it myself, everything seems to work. But for reinsurance, I would like still understand the physics of this phenomenon.Perhaps the underscore "_" equates to some character?
And it would be nice to write instead of this: "box-how-help__more box-how-help__more_active"
write, say, like this - "box- how-help__more _active".
To be or not to be? ))

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stalker_RED, 2017-07-20
@Nameless08

Moreover, class names must begin with a Latin character, and not with a hyphen or a number. "- though nothing is said about the underscore.
Where is this written?
It is impossible with a number, with two hyphens in a row, and with a combination of a hyphen and a number.
https://www.w3.org/TR/CSS21/syndata.html#characters
And you can have as many underscores at the beginning as you like.

R
RaulDuke, 2017-07-20
@RaulDuke

I use it extensively for helpers and component states. If I'm not mistaken, BEM is also not shy.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question