SummaryEdit
CSS type selectors match elements by node name. Used alone, therefore, a type selector for a particular node name selects all elements of that type — that is, with that node name — in the document.
SyntaxEdit
How to read CSS syntax.element { style properties }
ExampleEdit
CSS
span {
background-color: DodgerBlue;
color: #ffffff;
}
HTML
<span>Here's a span with some text.</span>
<p>Here's a p with some text.</p>
<span>Here's a span with more text.</span>
Result
SpecificationsEdit
Specification | Status | Comment |
---|---|---|
Selectors Level 4 The definition of 'Type (tag name) selector' in that specification. |
Working Draft | No change |
Selectors Level 3 The definition of 'type selectors' in that specification. |
Recommendation | No change |
CSS Level 2 (Revision 1) The definition of 'type selectors' in that specification. |
Recommendation | |
CSS Level 1 The definition of 'type selectors' in that specification. |
Recommendation | Initial definition |
Browser compatibilityEdit
Document Tags and Contributors
Tags:
Contributors to this page:
pcat,
Sebastianz,
cvrebert,
MusikAnimal,
SphinxKnight,
FredB,
teoli,
Sheppy,
ethertank,
tw2113,
Pointy,
Miken32,
Waldo,
Wjjohnst
Last updated by:
pcat,