如何使文本区域可通过鼠标滚动,同时仍然移除滚动条?

huangapple go评论59阅读模式
英文:

How to make a textarea scrollable with the mouse while still having the scrollbar removed?

问题

我认为滚动条看起来不美观。我已将其移除,但现在无法使用鼠标滚动。我在网上搜索未找到任何解决方法。是否有帮助?

我尝试使其看起来更清爽,我期望滚动条会消失,事实上也确实消失了,但现在文本区域不再可滚动。

英文:

As the title says, I think a scrollbar looks ugly. I removed it, but now it's not mouse-scrollable. I searched online and found nothing. Any help?

I tried to make it look cleaner, i expected the scrollbar to dissapear, which it did, but now the textarea is no longer scrollable

答案1

得分: 1

以下是翻译好的内容:

.element {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.element::webkit-scrollbar {
  display: none;
}
英文:

I think this could effectively (and fairly cross-browser) be achieved with the following CSS:

.element {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.element::webkit-scrollbar {
  display: none;
}

huangapple
  • 本文由 发表于 2023年5月21日 20:44:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/76299968.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定