CSS: Selector. Index
CSS: type selector (tag name)
By Xah Lee. Date:
2010-03-12
. Last updated:
2026-05-06
.
tag-name
Match a tag name.
/*
make all paragraphs red
*/
p
{
color
:
red
; }
HTML: List of HTML Tags
CSS. Selectors
CSS: Selector tutorial
Selector types
CSS: types of selectors
CSS: simple selectors
CSS: compound selectors
CSS: combinator selectors
Simple selectors
CSS: type selector (tag name)
CSS: universal selector (* any tag)
CSS: class selector (.x)
CSS: ID selector (#)
CSS: attribute selector ([x])
Combinators
CSS: descendant selector (space)
CSS: child selector (>)
CSS: adjacent sibling selector (+)
CSS: subsequent sibling selector (~)
Selector list
CSS: selector list (,)
CSS: :is any of selector
CSS: :where selector (is any of)
Nesting syntax
CSS: nesting selector (ampersand &)
Special selector
CSS: :root selector
CSS: no child selector
CSS: first child, last child, only child selectors
CSS: nth-child selector
CSS: nth-child arg of selector
CSS: nth-of-type selector
CSS: pseudo-class selector (:)
CSS: pseudo-element selector (::)
CSS: :not negation selector
CSS: :has descendant selector
Misc
CSS: pseudo-class function selector
CSS: Specificity (selector priority)
Search 🔍
CSS tutorial
Basics
Selector
Width
Box Model
Layout
Position
Media Query
Special Values
Cascade
Color
Font
Text
Text Deco
Background
Gradient
Animation, Transform
Misc. Index