CSS 滚动条样式

CSS 滚动条样式

滚动条样式实际应用

此示例定义了一个薄滚动条,带有红色滑块和橙色轨道。要查看滑块,你需要滚动文本。滚动条可见后,将鼠标悬停在其上以查看轨道。

.poem {

width: 300px;

height: 100px;

border: 1px solid;

}

css.poem {

overflow: scroll;

scrollbar-color: red orange;

scrollbar-width: thin;

}

A Small Needful Fact

Is that Eric Garner worked

for some time for the Parks and Rec.

Horticultural Department, which means,

perhaps, that with his very large hands,

perhaps, in all likelihood,

he put gently into the earth

some plants which, most likely,

some of them, in all likelihood,

continue to grow, continue

to do what such plants do, like house

and feed small and necessary creatures,

like being pleasant to touch and smell,

like converting sunlight

into food, like making it easier

for us to breathe.

>

- Ross Gay

注意:自定义滚动条时,请确保滑块和轨道与周围背景有足够的对比度。此外,请确保滚动条的点击区域足够大,以方便使用触摸输入的用户。

相关推荐

Win11玩红警2突然就卡住不动?
365手机卫士

Win11玩红警2突然就卡住不动?

📅 10-04 👁️ 9615
《问道》手游新服开服多久可以满级?
365手机卫士

《问道》手游新服开服多久可以满级?

📅 07-14 👁️ 9563
马匹游戏有哪些好玩 十大必玩马匹游戏精选
beat365在线体育打不开

马匹游戏有哪些好玩 十大必玩马匹游戏精选

📅 10-07 👁️ 783