I want to show a vertical scrollbar (if it is required) on a div only upon hover'ing that div.
This is achieved via
.my-div-class {
overflow: hidden;
}
.my-div-class:hover {
overflow-y: auto;
}
However when scrollbar appears (upon hover'ing) all the contents inside that div moves and wraps, which is not desired. Do I have an option to "pre-book" space for vertical scrollbar always, so that my div contents is always wrapped (though scrollbar itself is transparent). And on-hover I just make that scrollbar visible.
This should be cross-browser supported.