-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscroll-state-scrollable.html
More file actions
83 lines (78 loc) · 2.32 KB
/
scroll-state-scrollable.html
File metadata and controls
83 lines (78 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Demo</title>
<style>
body {
display: flex;
gap: 20px;
}
.container {
container-type: scroll-state;
height: 300px;
overflow: auto;
}
@container scroll-state(scrollable: top) {
p { color: red; }
}
.test-1 {
width: 200px;
border: 3px solid tomato;
}
.test-2 {
display: flex;
width: 200px;
gap: 10px;
border: 3px solid limegreen;
}
</style>
<style>
@supports not (container-type: scroll-state) {
body::before {
/* 日本語で */
content: "お使いのブラウザは、scroll-stateのコンテナクエリーをサポートしていません。";
position: fixed;
top: 0;
left: 0;
width: 100%;
background: black;
color: white;
text-align: center;
padding: 10px;
}
}
</style>
</head>
<body>
<div class="container test-1">
<p>
The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.
</p>
<p>
The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.
</p>
<p>
The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.
</p>
<p>
The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.
</p>
</div>
<div class="container test-2">
<p>
The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.
</p>
<p>
The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.
</p>
<p>
The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.
</p>
<p>
The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.
</p>
</div>
</body>
</html>