Universal selector
The universal selector is used to select all elements within an element.
If no element is provided then the root (html
element) is used.
The selector is symbolised as *
.
HTML
<div>This is a div</div> <span>This is a span</span> <button>This is a button</button> <textarea>This is a textarea</textarea>
CSS
*{
color: #0a0;
}
The following demonstrates the above sample:
This is a div
This is a span
Did you know my courses are all printer-friendly? This means you can easily export them to PDF or print them for later use.