Scroll bars showing on printed page in IE9?
Asked Answered
O

5

10

I'm having an issue with IE9 showing horizontal scroll bars on a printed page even though the contents of the page fit entirely. I've tried several things to remove them in my print css. Has anyone else had this issue and found a way around it?

Obese answered 10/3, 2011 at 17:20 Comment(5)
have you tried overflow: hidden?Poach
Yes. I've also hidden everything on the page and the scroll bars still appear.Obese
is this in print preview or in the printed page itself?Poach
Have you tried to style scrollbars? my guess is that IE still support that.. but are you sure you applied overflow:hidden to the right element? or is in a frame or something? May be it's an advertismenet with bad css?Corneliacornelian
It would be of much help if you provided a link or screenshot of your current issue.Fabrianna
H
13

I faced the same issue. It is a funny fix. Define the overflow property as important. It works. LOL on IE.

overflow:hidden !important;
Hepatitis answered 22/5, 2012 at 7:52 Comment(1)
Also worth noting is that you could use overflow:visible!important; too. This also gets rid of the scrollbars but shows any content outside.Keewatin
C
2

I have had this issue several times with IE in the past. It is usually a margin issue. Different browsers calculate margins differently. How are you positioning the elements? Do you have a fixed-width wrapper around the content or does the body expand to the browser width? It's really difficult to pinpoint the problem without the actual css code.

I would suggest removing any negative margins you have (IE does not like these), and check to see if you have any right margins on elements that are unnecessary.

Comely answered 27/3, 2011 at 4:2 Comment(0)
N
0
@media print{

    .dont-print
     {
        overflow:hidden;
     }

}

dont-print is just a class name which i've used before, changed that to whatever you need

Nelidanelie answered 11/10, 2013 at 13:21 Comment(0)
M
0

Use following code on body tag in JavaScript function print:

printWin.document.write(
  '<style>div {overflow: visible !important; height:auto !important;}</style>'
);
Money answered 9/4, 2018 at 7:33 Comment(0)
E
-1

Are you sure you set the right stylesheet media type? Like:

<link rel="stylesheet" href="print.css" type="text/css" media="print" />`

And try the following in your print.css:

html, body { overflow-x: hidden; }
Essayist answered 11/3, 2011 at 10:6 Comment(1)
Instead you can try: html, body { overflow: auto; }Judaea

© 2022 - 2024 — McMap. All rights reserved.