CSS Universal Selector

Notes:

CSS - Universal Selector (*):
It is used to target any html element on page and apply styles on it.

Syntax of universal Selector:
*
{
declaration list;
}
It targets to any html element on the page

Ex:
*
{
border:2px solid red;
}
It selects every html element on the page and applies 2px solid red border

*.firsttwo
{
border:2px solid red;
}
It selects any html element which has class attribute value set to firsttwo

*#container
{
border:2px solid red;
}
It selects any html element which has id attribute value set to container

* > p
{
border:2px solid red;
}
It selects any p element which is the direct child of any html element

Interview Questions: