what is the asteris selector and what is its specificity the universal selector is a special type of CSS selector that matches any element in the document it is often used to apply a style to all elements on the page which can be useful for resetting or normalizing Styles across different browsers the universal selector can be used to select all elements within a specific Contex text or globally across the entire document here is an example of using the universal selector for setting the margin and padding for the entire HTML document in this code example the universal
selector resets the margin and padding of all elements to zero which is a common technique used in CSS resets the universal selector has the lowest specificity value of any selector it contrib rutes Zer to all parts of the specificity value 0 0 0 0 this means that any other selector including type selectors class selectors ID selectors and inline Styles will overwrite the Styles set by the universal selector let's take a look at the following HTML and CSS example the universal selector sets the text color to Blue for all elements however the P types selector overwrites
this by setting the text color to Red specifically for p elements if an element has the Highlight class the class selector takes precedence changing the text color to Green finally the unique ID selector which has the highest specificity will override all others setting the text color to purple