Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a Webpage(HTML page),I want to print Page data on paper(has large content More then 10 pages).
I want Header and footer should be repeated in all the pages when I give print.
How should I achive this?

I found some solution like below


JavaScript
<style type="text/css">
    @media screen {
        div.divFooter {
            display: none;
        }
    }
    @media print {
        div.divFooter {
            position: fixed;
            bottom: 0;
        }
    }
</style>


But It is not work for me, '@media' element is showing as error.

Can anyone please suggest How I will achive this as am using asp.net mvc razor view.

Note:Currently am using google chrome browser

Thanks in advance
Posted
Updated 13-Aug-13 21:35pm
v4
Comments
Shubhashish_Mandal 14-Aug-13 3:02am    
check out the version that you have used whether support @media or not
http://caniuse.com/css-mediaqueries
kirankoleti 14-Aug-13 4:20am    
Using MVC4 its internally supports HTML5

1 solution

Unfortunately, not all layout engines correctly support @media features. Typically, they don't. This is not your application, these are browsers. You cannot do anything about it, except waiting until browsers improve.

For more detail on each engine per feature, please see: http://en.wikipedia.org/wiki/Comparison_of_layout_engines_%28CSS%29[^].

—SA
 
Share this answer
 
Comments
Joezer BH 14-Aug-13 9:11am    
5ed!
Sergey Alexandrovich Kryukov 14-Aug-13 9:38am    
Thank you.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900