Skip to content

Commit 4beb8d9

Browse files
committed
[css-images-4] Make the element() examples use stacking contexts, as the issue says.
1 parent 8da9c06 commit 4beb8d9

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

css-images-4/Overview.bs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ Using Elements as Images: the ''element()'' notation</h3>
208208

209209
<pre>
210210
&lt;style>
211-
#src { color: white; background: lime; width: 300px; height: 40px; }
211+
#src { color: white; background: lime; width: 300px; height: 40px; position: relative; }
212212
#dst { color: black; background: element(#src); padding: 20px; margin: 20px 0; }
213213
&lt;/style>
214214
&lt;p id='src'>I'm an ordinary element!&lt;/p>
@@ -279,9 +279,9 @@ Using Elements as Images: the ''element()'' notation</h3>
279279

280280
<pre>
281281
&lt;!DOCTYPE html>
282-
&lt;p id='one' style="display:none;">one&lt;/p>
282+
&lt;p id='one' style="display:none; position: relative;">one&lt;/p>
283283
&lt;iframe src="http://example.com">
284-
&lt;p id='two'>I'm fallback content!&lt;/p>
284+
&lt;p id='two' style="position: relative;">I'm fallback content!&lt;/p>
285285
&lt;/iframe>
286286
&lt;ul>
287287
&lt;li style="background: element(#one);">
@@ -326,6 +326,10 @@ Using Elements as Images: the ''element()'' notation</h3>
326326
}
327327
&lt;/script>
328328
&lt;style>
329+
.slide {
330+
/* Need to be a stacking context to be element()-able. */
331+
position: relative;
332+
}
329333
#prev-preview, #next-preview {
330334
position: fixed;
331335
...

0 commit comments

Comments
 (0)