Why some charactors are not allowed as CSS selectors?

  Kiến thức lập trình

I had two h2 headings in html. I wanted to style them separately using CSS. for that I tried to use numbers ‘1’ and ‘2’ as class names. But when I tried to select them using h2.1 , h2.2 in CSS selectors it did not work. Then I googled and got to know there are some characters not allowed a CSS selectors. Now I know there are some rules for selectors. But I am wondering the reason why CSS has prohibited some characters as selectors ?!

I could not find the reason behind this using google. Only the rules and allowed characters are available in Google. Can someone explain the reason why some characters are not allowed as selectors?!

New contributor

Yousuf Ithfi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website Kho Theme wordpress Kho Theme WP Theme WP

LEAVE A COMMENT