You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42Lines changed: 42 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,3 +110,45 @@ A child element [inherits](https://www.w3.org/TR/css-cascade-4/#inheriting) [inh
110
110
111
111
>**Issue:**
112
112
> What should happen with non-inherited properties? Same as for [`::first-line`](https://www.w3.org/TR/css-pseudo-4/#first-line-pseudo) ([issue 1097](https://github.com/w3c/csswg-drafts/issues/1097))
113
+
114
+
## Interaction with the [CSS Generated Content Module](https://drafts.csswg.org/css-content/)
115
+
116
+
As a [tree-abiding pseudo-element](https://www.w3.org/TR/css-pseudo-4/#treelike), the [`content`](https://drafts.csswg.org/css-content/#content-property) property applies to `::contents`.
For elements and `::contents` pseudo-elements, this computes to [`contents`](https://drafts.csswg.org/css-content/#valdef-content-contents).
121
+
122
+
For [`::before`](https://www.w3.org/TR/css-pseudo-4/#selectordef-before) and [`::after`](https://www.w3.org/TR/css-pseudo-4/#selectordef-after) pseudo-elements, this computes to [`none`](https://drafts.csswg.org/css-content/#valdef-content-none).
On elements, this inhibits the `::contents` pseudo-element (together with the actual contents of the element) from being rendered as a child of this element, as if the pseudo-element had [`display: none`](https://www.w3.org/TR/css-display-3/#valdef-display-none).
127
+
128
+
On `::contents` pseudo-elements, this inhibits the actual children of the originating element from being rendered as children of this pseudo-element, as if the element was empty.
129
+
130
+
On other pseudo-elements, this inhibits the creation of the pseudo-element as if it had [`display: none`](https://www.w3.org/TR/css-display-3/#valdef-display-none).
Makes the element or pseudo-elementa replaced element, filled with the specified `<image>`. Its normal contents are suppressed and do not generate boxes, as if they were [`display: none`](https://www.w3.org/TR/css-display-3/#valdef-display-none).
135
+
136
+
>**Note:** Replaced elements do not have [`::before`](https://www.w3.org/TR/css-pseudo-4/#selectordef-before), [`::after`](https://www.w3.org/TR/css-pseudo-4/#selectordef-after) or `::contents` pseudo-elements; the content property replaces their entire contents.
On elements, this replaces the `::contents` pseudo-element with one or more anonymous inline boxes corresponding to the specified values, in the order specified. The `::contents` pseudo-element (together with the actual contents of the element) is suppressed and does not generate boxes, as if it had [`display: none`](https://www.w3.org/TR/css-display-3/#valdef-display-none).
141
+
142
+
On pseudo-elements, this replaces the pseudo-element’s contents with one or more anonymous inline boxes corresponding to the specified values, in the order specified. Its normal contents are suppressed and do not generate boxes, as if they had [`display: none`](https://www.w3.org/TR/css-display-3/#valdef-display-none).
On elements, this allows the creation of the `::contents` pseudo-element. It is useless to include [`contents`](https://drafts.csswg.org/css-content/#valdef-content-contents) twice in a single `content` property, because the second occurrence simply has no effect, as there can only be a single `:contents` pseudo-element.
147
+
148
+
On pseudo-elements, this makes the contents of the pseudo-element be the actual contents of the originating element. It is useless to include `contents` more than once in a single `content` property or use [`contents`](https://drafts.csswg.org/css-content/#valdef-content-contents) in multiple pseudo-elements, because only the first occurrence has an effect, as there the actual contents of the originating element cannot be duplicated. It is also useless to use `contents` in multiple pseudo-elements.
149
+
150
+
When used in multiple pseudo-elements, the first occurrence is searched in the following order:
151
+
152
+
1. In the `::contents` pseudo-element, but only if [`contents`](https://drafts.csswg.org/css-content/#valdef-content-contents) is used on the originating element.
153
+
2. In the [`::before`](https://www.w3.org/TR/css-pseudo-4/#selectordef-before) pseudo-element
154
+
3. In the [`::after`](https://www.w3.org/TR/css-pseudo-4/#selectordef-after) pseudo-element
0 commit comments