CSS Selector
CSS Selector is used to select the DOM to which we like to target.
Table of contents
CSS Selector
Types of Selector
Basic Selector
Universal selector
Properties written under universal selector are applied to each element of HTML.
Example: * or star operator
Type Selector
Properties written under type selector are applied to each element that matched the element name.
Example : div ,span, input, h1, p
Class Selector
Properties written under class selector are applied to Dom where class attributes are added.
Example: .first, .second, .third
ID Selector
Properties written under id selector are applied to Dom where id attributes are added
Example: #user1, #user2, #user3
Attribute Selector
Properties written under attribute selector are applied to Dom where attribute matches.
Example: [port1], [port2], [port3]
Grouping Selector
- Selector List
A group selector separates each element of the Dom by ,