Is there a scrollbar element in HTML ?
If not, how can a scrollbar be created? I tried using a div with overflow but the problem is that I have to add content in order for the scrollbar to appear, and if I add content it will be visible.
CSS:
.h-scrollbar { overflow-x: scroll; width: 300px; } .h-scrollbar div { width: 1000px; display:block; } HTML:
<div class="h-scrollbar"><div>text</div></div> Here is a demo: http://jsfiddle.net/4e8jbbc0/1/
How can I get only the scrollbar?
body). I want to create a scrollbar element so I can get the events on it. I only need thescrollbar.overflow-x: scrollandoverflow-y: scrollcreate persistent scrollbars without adding content. There is no scrollbar element in HTML, but you could hypothetically create an HTML element and program it to act like a scrollbar.JavaScript:)