YADA (yet another (different) solution)
Note: Take note of the valuable insight shared by BoltClock in the comment below regarding type versus tag versus element. While I usually overlook semantics, his point is quite significant and enlightening.
Despite the existing array of responses, the fact that your professor encouraged you to post this question suggests that you are (officially) enrolled in school. In light of this, I wanted to delve deeper into not only CSS but also the inner workings of web browsers. As stated by Wikipedia, "CSS is a style sheet language used for describing ... a document written in a markup language." (I highlighted "a") It is important to note that it does not specify "written in HTML" nor a particular version of HTML. CSS can be applied to HTML, XHTML, XML, SGML, XAML, etc. Naturally, you require something to display each of these document types while also applying styling. Essentially, CSS does not recognize / comprehend / consider specific markup language tags. Therefore, the tags may be deemed "invalid" in terms of HTML, but there is no such concept of a "valid" tag/element/type in CSS.
Modern web browsers are not homogeneous entities. They consist of various "engines" tasked with specific functions. At a minimum, I can identify 3 engines: the rendering engine, the CSS engine, and the JavaScript engine/VM. I'm uncertain if the parser is part of the rendering engine (or vice versa) or if it operates independently, but you grasp the concept.
Whether a visual browser (others have already discussed the challenges screen readers might encounter with invalid tags) applies the styling hinges on whether the parser retains the "invalid" tag in the document and if the rendering engine actually enforces styles on that tag. For ease of development and maintenance, CSS engines are not programmed to comprehend that "This is an HTML document, so these are the valid tags / elements / types." Instead, CSS engines simply identify tags / elements / types and convey to the rendering engine, "Here are the styles to apply." Ultimately, the rendering engine decides whether to implement the styles or not.
Here's a simple way to conceptualize the basic flow from one engine to another: parser -> CSS -> rendering. While the actual process is more intricate, this serves as a decent starting point.
Given the length of this response, I'll conclude here.