In CSS, can we select any HTML element by using its tag name as demonstrated in this exercise?


#1

Question

In CSS, can we select any HTML element by using it’s tag name as demonstrated in this exercise? Could I even create selectors to target HTML elements in the head of a document? For example, can I change the color of tab text with a title tag selector?

Answer

No. CSS is used to style our pages. As <head> tag content is not visible on the page itself, we can not target this metadata with tag selectors.


FAQ: Learn CSS Selectors Visual Rules - CSS Setup Selectors - Tag Name
#2

Good to know! Great question!


#3

Agreed with coder_brewer. I always wondered that myself!