0% completed
The global selector applies a style rule to every element on the page. This selector is represented by an asterisk (*). Using the global selector allows you to set default styles across the entire document.
When you use the global selector, the styles you define affect all HTML elements unless they are overridden by a more specific selector.
Follow below syntax to use the global selector in CSS code.
* { property: value; }
Explanation:
In this example, we will reset the margin and padding of all elements to create a consistent starting point for styling.
.
Explanation:
Note: We will learn about margin and padding in the upcoming chapters.
This lesson demonstrates the power of the global selector by applying styles that affect all elements. You learned how to reset default properties and ensure consistent element sizing using the universal selector
.....
.....
.....