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