Html 设置滚动条的样式

Html 设置滚动条的样式,html,css,Html,Css,我已经实现了一个带有滚动条的部分,它将显示描述。现在工作正常了。但它现在有了默认样式。我想自定义样式的滚动条,使它看起来很好 HTML代码 <div class="desc" style="width:100px; height:300px; overflow: auto; background:#CCC;" > Lorem Ipsum is simply dummy text of the printing and typesetting industry.

我已经实现了一个带有滚动条的部分,它将显示描述。现在工作正常了。但它现在有了默认样式。我想自定义样式的滚动条,使它看起来很好

HTML代码

      <div class="desc" style="width:100px; height:300px; overflow: auto; background:#CCC;" >
      Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem           Ipsum has been the industry's standard dummy text ever since the 1500s,           when an unknown printer took a galley of type and scrambled it to make a           type specimen book. It has survived not only five centuries, but also the leap           into electronic typesetting, remaining essentially unchanged. It was           popularised in the 1960s with the release of Letraset sheets containing           Lorem Ipsum passages, and more recently with desktop publishing           software like Aldus PageMaker including versions of Lorem Ipsum.
      </div>

Lorem Ipsum只是印刷和排版行业的虚拟文本。自16世纪以来,Lorem Ipsum一直是行业标准的虚拟文本,当时一位不知名的印刷商拿起一个打印工具,将其拼凑成一本打印样本书。它不仅存活了五个世纪,而且还跨越到电子排版,基本上保持不变。它在20世纪60年代随着包含Lorem Ipsum段落的Letraset表单的发布而流行,最近随着Aldus PageMaker等桌面出版软件的发布,包括Lorem Ipsum版本。

CSS滚动条属性可用于自定义它。例如:

scrollbar-3dlight-color
scrollbar-arrow-color
scrollbar-base-color
scrollbar-darkshadow-color
scrollbar-face-color
scrollbar-highlight-color
有关详细答案,请浏览:

您可以使用slim scroll插件进行此操作。

这可能会有所帮助:谢谢。我试过了,现在看起来不错。但不幸的是,它采用了firefox中的本地滚动条样式:(