Skip to content

Commit 14a151c

Browse files
committed
type() example
1 parent 99e3912 commit 14a151c

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

images/image-set-type.html

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<!doctype html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<title>image-set() type()</title>
7+
<link rel="stylesheet" href="styles.css">
8+
<style>
9+
.box {
10+
width: 400px;
11+
height: 200px;
12+
background-repeat: no-repeat;
13+
background-size: cover;
14+
}
15+
</style>
16+
17+
<style class="editable">
18+
.box {
19+
background-image: image-set(
20+
url("large-balloons.avif") type("image/avif"),
21+
url("large-balloons.jpg") type("image/jpeg"));
22+
}
23+
</style>
24+
</head>
25+
26+
<body>
27+
<section class="preview">
28+
<div class="box"></div>
29+
</section>
30+
31+
<textarea class="playable playable-css" style="height: 150px;">
32+
.box {
33+
background-image: image-set(
34+
url("large-balloons.avif") type("image/avif"),
35+
url("large-balloons.jpg") type("image/jpeg"));
36+
}
37+
</textarea>
38+
39+
<textarea class="playable playable-html" style="height: 70px;">
40+
<div class="box"></div>
41+
</textarea>
42+
43+
<div class="playable-buttons">
44+
<input id="reset" type="button" value="Reset">
45+
</div>
46+
</body>
47+
<script src="playable.js"></script>
48+
49+
</html>

images/large-balloons.avif

38.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)