CSS universal selector

The universal selector (*), matches the name of any element type. It matches any single element in the document tree. Some ways it can be used:

* matches any element
(equivalent to .warning)
matches any element with class=warning
#id1 * matches any descendendant of element with id=id1
#id1 > * matches any direct child of element with id=id1

Example – universal selector

#id1 * {
  border: 1px solid lightblue;

<div id="id1">

<div id="id2">



Share this article: share on Google+ share on facebook share on linkedin tweet this submit to reddit


Click here to write/view comments