javascript - Hide Vertical Scrollbar in Chrome while printing - Stack Overflow

How can I remove the scrollbar while I print report in Chrome Browser.Here is my code:<style>@me

How can I remove the scrollbar while I print report in Chrome Browser. Here is my code:

<style>
     @media print {
         @page {
             size: A4 portrait;
             margin:1cm;
         }
</style>

Here is the picture:

How can I remove the scrollbar while I print report in Chrome Browser. Here is my code:

<style>
     @media print {
         @page {
             size: A4 portrait;
             margin:1cm;
         }
</style>

Here is the picture:

Share Improve this question edited Sep 11, 2019 at 9:55 user5734311 asked Sep 11, 2019 at 9:53 Abdullah Al ZuhairAbdullah Al Zuhair 412 silver badges9 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 3

This is the solution I found:

 @media print{
            @page {
                size: A4 portrait;
                margin:1cm;
            }
            ::-webkit-scrollbar {
                display: none;
            }
        }

overflow: hidden is the css property you are looking for. It removes the scrollbar and removes overflowing content. See: https://developer.mozilla/en/docs/Web/CSS/overflow

<style>
     @media print{
         @page {
             size: A4 portrait;
             margin:1cm;
             overflow: hidden;
            }
     }
</style>

Or try to set the overflow hidden without depending on the media query:

html { overflow: hidden; }

If this does not help for printing, maybe have a look at the answer of following question: How to hide the scroll bar and with the content ramaining scrollable?

As mentioned there you could try to set the width of the scrollbar to zero for webkit browsers.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745484423a4629702.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信