The universal selector is used to select all elements on a web page.
It is represented by the asterisk (*) symbol.
This selector affects every HTML element, so it should be used carefully.
This code selects all elements on the page and removes default margin.
It is often used for layout reset.
This example attaches a click event to all elements.
This is useful for debugging but not recommended in production.
This code adds a class to every element on the page.
Use this selector carefully to avoid performance issues.
Universal Selector Notes:
- Uses * symbol
- Selects all elements
- Can affect performance
- Mostly used for testing or reset