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 (~)
Any-of selectors
CSS: selector list (,)
CSS: :is any of selector
CSS: :where selector (is any of)
Nesting syntax
CSS: nesting selector (ampersand &)
Parent-like selector
CSS: :root selector
CSS: no child selector
CSS: :has descendant selector
Nth-child
CSS: first child, last child, only child selectors
CSS: nth-child selector
CSS: nth-child arg of selector
CSS: nth-of-type selector
Special selector
CSS: :not negation selector
CSS: pseudo-class selector functions
CSS: pseudo-class selector (:)
CSS: pseudo-element selector (::)
Specificity
CSS: Specificity (selector priority)
Web dev Search 🔍
HTML
CSS
JS
JS Obj Ref
JS DOM
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