(Further to the previous post
It's largely down to context.
In the HTML code, "H1" is an HTML element, but when used in a CSS stylesheet, it becomes part of a selector which specifies which element(s) should have a particular set of formatting rules applied. Being used as a selector in the context of a CSS stylesheet doesn't stop it being an element in the context of HTML.