Selectors are the part of CSS rule set. CSS selectors select HTML elements according to their id, class, or element. The video below demonstrates how they are used.
Note: The YouTuber uses an external style sheet to declare his code. You can use < head > and < style > tags to declare your selectors.
CSS selectors
4 different types of CSS selectors
Universal
Class
ID
Element
Universal
Applies styling to everything on the web page. Identified with an asterisk *
Class
Named in individual html tags. Identified with a full stop . followed by the class value/name.
ID
Named in individual html tags. Identified with a hashtag# followed by the id value/name.
Element
This is called by using thename of an html tag. i.e. p/h/h1. Styling will apply to all the text with those tags.