From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/css/scrollbar-width/index.html | 110 +++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 files/zh-cn/web/css/scrollbar-width/index.html (limited to 'files/zh-cn/web/css/scrollbar-width') diff --git a/files/zh-cn/web/css/scrollbar-width/index.html b/files/zh-cn/web/css/scrollbar-width/index.html new file mode 100644 index 0000000000..e40be4ef7c --- /dev/null +++ b/files/zh-cn/web/css/scrollbar-width/index.html @@ -0,0 +1,110 @@ +--- +title: scrollbar-width +slug: Web/CSS/scrollbar-width +translation_of: Web/CSS/scrollbar-width +--- +
{{CSSRef}}{{SeeCompatTable}}
+ +

 scrollbar-width 属性允许开发者设置滚动条出现时的厚度

+ +

{{EmbedInteractiveExample("pages/css/scrollbar-width.html")}}

+ +

{{cssinfo}}

+ +

Syntax

+ +
/* Keyword values */
+scrollbar-width: auto;
+scrollbar-width: thin;
+scrollbar-width: none;
+
+/* Global values */
+scrollbar-width: inherit;
+scrollbar-width: initial;
+scrollbar-width: unset;
+
+ +

Values

+ +
+
<scrollbar-width>
+
将滚动条的宽度定义为数值宽度或者预定义宽度,当被定义为预定义宽度时,则必须为下列值之一: + + + + + + + + + + + + + + + +
auto系统默认的滚动条宽度
thin系统提供的瘦滚动条宽度,或者比默认滚动条宽度更窄的宽度
none不显示滚动条,但是该元素依然可以滚动
+ +

注意:scrollbar-width的长度值有可能从规范中删除,scrollbar-width属性本身也是如此。 (Issue 1958)

+ +
+

Note: User Agents must apply any scrollbar-width value set on the root element to the viewport.

+
+
+
+ +

Formal syntax

+ +
{{CSSSyntax}}
+ +

Example

+ +

CSS

+ +
.scroller {
+  width: 300px;
+  height: 100px;
+  overflow-y: scroll;
+  scrollbar-width: thin;
+}
+ +

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>
+ +

Result

+ +

{{EmbedLiveSample("Example")}}

+ +

Specifications

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("CSS Scrollbars", "#scrollbar-width", "scrollbar-width")}}{{Spec2("CSS Scrollbars")}}Initial Definition
+ +

Browser compatibility

+ + + +

{{Compat("css.properties.scrollbar-width")}}

+ +

See also

+ + -- cgit v1.2.3-54-g00ecf