blob: 0c2c9659f3d4a71b357f99c35bb0370d837bea7b (
plain)
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
84
85
86
|
---
title: CSS Scrollbars
slug: Web/CSS/CSS_Scrollbars
translation_of: Web/CSS/CSS_Scrollbars
---
<div>{{CSSRef}}{{SeeCompatTable}}</div>
<p class="summary"><span class="seoSummary"><strong>CSS Scrollbars</strong>标准化了由ie5引入的废弃的滚动条颜色属性</span></p>
<h2 id="基础例子">基础例子</h2>
<p>在这个例子里 我们选择使用一个比较细的 滚动轨道为绿色,滚动块为紫色的滚动条</p>
<div id="Example">
<pre class="brush:css">.scroller {
width: 300px;
height: 100px;
overflow-y: scroll;
scrollbar-color: rebeccapurple green;
scrollbar-width: thin;
}</pre>
<h3 id="HTML">HTML</h3>
<pre class="brush: html"><div class="scroller">
Veggies es bonus vobis, proinde vos postulo essum magis kohlrabi
welsh onion daikon amaranth tatsoi tomatillo melon azuki bean garlic.
Gumbo beet greens corn soko endive gumbo gourd. Parsley shallot courgette
tatsoi pea sprouts fava bean collard greens dandelion okra wakame tomato.
Dandelion cucumber earthnut pea peanut soko zucchini.
</div></pre>
<h3 id="Result">Result</h3>
<p>{{EmbedLiveSample("Example")}}</p>
</div>
<h2 id="Reference">Reference</h2>
<h3 id="CSS_Properties">CSS Properties</h3>
<div class="index">
<ul>
<li>{{CSSxRef("scrollbar-width")}}</li>
<li>{{CSSxRef("scrollbar-color")}}</li>
</ul>
</div>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName("CSS Scrollbars")}}</td>
<td>{{Spec2("CSS Scrollbars")}}</td>
<td>Initial definition.</td>
</tr>
</tbody>
</table>
<h2 id="Accessibility_concerns" name="Accessibility_concerns">Accessibility concerns</h2>
<p>When you customize scrollbars, consider they have enough contrast and that their hit area is large enough for people who use touch input.</p>
<ul>
<li><a href="http://adrianroselli.com/2019/01/baseline-rules-for-scrollbar-usability.html">Baseline Rules for Scrollbar Usability | Adrian Roselli</a></li>
</ul>
<h2 id="Browser_compatibility" name="Browser_compatibility">Browser compatibility</h2>
<h3 id="scrollbar-width">scrollbar-width</h3>
<div>{{Compat("css.properties.scrollbar-width")}}</div>
<h3 id="scrollbar-color">scrollbar-color</h3>
<div>{{Compat("css.properties.scrollbar-color")}}</div>
|