To use this website fully, you first need to accept the use of cookies. By agreeing to the use of cookies you consent to the use of functional cookies. For more information read this page.

Universal selector

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
Provide feedback on this page
Comments are sent via email to me.