Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

@media print css issue

Tags:

css

height

I have added media print css like this

@media print
{
    div#file1 {
        height: 100%!important;
        overflow: scroll;
    }
}

Problem is that it is working fine in firefox but not in chrome while printing. it doesn't take height in chrome. WHen i try to give min-height: 100% to div then it is working but print only visible area not after scroll.

like image 806
Neel Avatar asked Mar 10 '26 12:03

Neel


1 Answers

You have specified you want a scrollbar on your div as well as the one normally on the browser and this can be done as:

 @media print { 
       div#file1{ 
           height: 100%!important; 
           overflow: -moz-scrollbars-vertical;
           overflow-y: scroll;
           overflow-x: hidden;
        } 
 }

This would resolve your issue

like image 119
Vineet1982 Avatar answered Mar 12 '26 01:03

Vineet1982



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!