Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide the scroll bar and with the content ramaining scrollable? [duplicate]

I want to print my html page into a PDF file, but don't want the scroll bar showing there in the PDF file. And my page have a scrollable body, so if I set this:

* {
   overflow: hidden;
}

The body will be incomplete in the final pdf file. So if there is a way just prevent the scrollbar from showing but the content still scrollable?

like image 608
David LIu Avatar asked Dec 11 '22 12:12

David LIu


1 Answers

You can set display of scrollbar to none by:

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

This will hide all the scrollbars without disabling scrolling.

Edit: this only works on chrome, for a better explanation you can check this answer Hidding Scrollbar

like image 89
Hue Avatar answered Dec 28 '22 08:12

Hue