CSS Selectors
CSS selectors are used to “attain” the HTML document component you want to style or makeover.
In CSS, there are five different types of selectors in CSS, which is given below.
- Element Selector
- Id Selector
- Class Selector
- Universal Selector
- Group Selector
The CSS Element Selector
In CSS element selector, we use the element name for the style to the HTML elements.
Example#1 In the given example all <p> text will be an increase in size and the text color will be black.
p { font-size: 12px; color: #000; }
The CSS id Selector
In CSS id Selector, we use the id attribute for the style of an HTML element to select a specific element.