concept

grammar-combinators — CSS reference

In value definitions adjacency requires components in the given order. && requires every component in any order; || requires one or more components in any order; | chooses exactly one alternative. Without grouping, adjacency binds most tightly, then &&, then ||, then |. Square brackets group grammar components; they are not normally typed as CSS tokens.

Formal Syntax & Structure

css syntaxcss
A B   |   A && B   |   A || B   |   A | B

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS reference lab</title><style>#a {border:solid 3px #006050} #b {border:#006050 3px solid}</style><body><div id="parent"><div id="a">Sample</div><div id="b">Comparison</div></div></body></html>
CSS Reference