Skip to content
Merged
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
c3ebe9a
added the :heading and :heading pages
dletorey Aug 5, 2025
c06d7bc
Merge branch 'main' into 40483-heading-selectors
dletorey Aug 6, 2025
dd69d01
finshed the :heading & :heading() pages
dletorey Aug 6, 2025
169f663
added note to :heading() and added both to pseudo-classes page
dletorey Aug 6, 2025
af829de
Merge branch 'main' into 40483-heading-selectors
dletorey Aug 6, 2025
10ceb0a
Update files/en-us/web/css/_colon_heading_function/index.md
dletorey Aug 6, 2025
e96bf2a
Update files/en-us/web/css/_colon_heading_function/index.md
dletorey Aug 6, 2025
984b927
Update files/en-us/web/css/_colon_heading_function/index.md
dletorey Aug 6, 2025
917d7f8
made explanation match code example
dletorey Aug 6, 2025
531fb9f
Update files/en-us/web/css/_colon_heading/index.md
dletorey Aug 11, 2025
77ac648
Update files/en-us/web/css/_colon_heading/index.md
dletorey Aug 11, 2025
0630303
Update files/en-us/web/css/_colon_heading/index.md
dletorey Aug 11, 2025
d2d981e
Update files/en-us/web/css/_colon_heading/index.md
dletorey Aug 11, 2025
a862da4
Update files/en-us/web/css/_colon_heading/index.md
dletorey Aug 11, 2025
396f6b5
Update files/en-us/web/css/_colon_heading/index.md
dletorey Aug 11, 2025
70af4d7
Update files/en-us/web/css/_colon_heading/index.md
dletorey Aug 11, 2025
2b93476
Update files/en-us/web/css/_colon_heading_function/index.md
dletorey Aug 11, 2025
1030607
Update files/en-us/web/css/_colon_heading_function/index.md
dletorey Aug 11, 2025
f258db7
Update files/en-us/web/css/_colon_heading_function/index.md
dletorey Aug 11, 2025
d587432
Update files/en-us/web/css/_colon_heading_function/index.md
dletorey Aug 11, 2025
96c21f7
Update files/en-us/web/css/_colon_heading/index.md
dletorey Aug 11, 2025
2667e9e
Merge branch 'main' into 40483-heading-selectors
dletorey Aug 11, 2025
1248fc1
fixed code blocks
dletorey Aug 11, 2025
faa1fc0
Merge branch 'main' into 40483-heading-selectors
dletorey Aug 11, 2025
ba72433
Update files/en-us/web/css/_colon_heading_function/index.md
dletorey Aug 11, 2025
1cb2752
updated the Note & parameters
dletorey Aug 11, 2025
9944d0c
Merge branch '40483-heading-selectors' of github.com:dletorey/content…
dletorey Aug 11, 2025
0c962f8
fixed the syntax example
dletorey Aug 11, 2025
1ef85b8
added a note about matching attributes
dletorey Aug 11, 2025
8070f80
moved the note to usage notes
dletorey Aug 11, 2025
bf5bdc8
Merge branch 'main' into 40483-heading-selectors
dletorey Aug 11, 2025
a7d3ed4
Merge branch 'main' into 40483-heading-selectors
dletorey Aug 11, 2025
714d935
Merge branch 'main' into 40483-heading-selectors
caugner Aug 11, 2025
c5f8d28
Update files/en-us/web/css/_colon_heading/index.md
dletorey Aug 18, 2025
0979834
Update files/en-us/web/css/_colon_heading_function/index.md
dletorey Aug 18, 2025
0ed3a0f
Update files/en-us/web/css/_colon_heading_function/index.md
dletorey Aug 18, 2025
a2bce13
Update files/en-us/web/css/_colon_heading_function/index.md
dletorey Aug 18, 2025
1587bc1
Update files/en-us/web/css/_colon_heading_function/index.md
dletorey Aug 18, 2025
6104a30
Update files/en-us/web/css/_colon_heading_function/index.md
dletorey Aug 18, 2025
509583b
Merge branch 'main' into 40483-heading-selectors
dletorey Aug 18, 2025
3e36ea9
fixed the code block not ending and the example of aria roles
dletorey Aug 18, 2025
6cc77c3
Merge branch 'main' into 40483-heading-selectors
dletorey Aug 18, 2025
beae4fc
Merge branch 'main' into 40483-heading-selectors
Josh-Cena Aug 19, 2025
afadf18
Update files/en-us/web/css/_colon_heading/index.md
dletorey Aug 19, 2025
66e65d7
Merge branch 'main' into 40483-heading-selectors
dletorey Aug 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion files/en-us/web/css/_colon_heading/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ sidebar: cssref
---

The **`:heading`** [CSS](/en-US/docs/Web/CSS) [pseudo-class](/en-US/docs/Web/CSS/Pseudo-classes) matches all [heading elements](/en-US/docs/Web/HTML/Reference/Elements/Heading_Elements) in a document. This allows you to style all headings at once, rather than matching and styling them individually.
This pseudo-class matches only elements that are semantically recognized as headings (`<h1>` through `<h6>`). Elements with [`role="heading"`](/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/heading_role) are not matched; you can select those by using the functional form, {{CSSXRef(":heading_function", ":heading()")}}.

This pseudo-class matches only elements that by default are semantically recognized as headings (`<h1>` through `<h6>`). Elements with [`role="heading"`](/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/heading_role) are not matched; you can select those by using the `[role="heading"]` [attribute selector](/en-US/docs/Web/CSS/Attribute_selectors).

> [!NOTE]
> The `:heading` pseudo-class has the same [specificity](/en-US/docs/Web/CSS/CSS_cascade/Specificity#how_is_specificity_calculated) as a class selector, that is, `0-1-0`. So `:heading` would have a specificity of `0-1-0`, and `section:heading` would have a specificity of `0-1-1`.
Expand Down