What characters can I use to define a class name?

Asked

Viewed 214 times

1

I know it is recommended to use letters and dash, but if I want to use a class teste1/10, which recommendation?

  • css class ?

  • 2

    The ideal is for you to maintain a pattern. For example, hj is very common for naming with letters, numbers, strokes and underline. I don’t recommend using other characters to avoid syntax problems when selecting the class via javascript or jQuery.

  • Yes Locahost, but I can do as I said?

1 answer

1


According to the Grammar of the CSS CSS you cannot use teste1/10.

A name must start with letters (a-z) or a hyphen (-) or underlined (_), or a letter (a-z), followed by any number, underlining, letters or numbers.

You can use teste110 or teste1-10 or teste1_10 in your case.

Based on that reply of the English stackoverflow.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.