My requriment is to provide 10cm margin to all the page when printing.
I'm printing using window.print()
. My web page will dynamically increase (so number of pages cannot be determined). For all the pages I need to provide margin of 10 cm.
I used CSS Media="Print"
, within which I defined the style:
@page
{
Margin-top :10cm;
}
This is working in all the browsers except Mozilla firefox. I searched for solutions and all the blogs say, Mozilla will not support @page
, but No Solution. Can someone help me on this?
Please let me know is it posible to implement in mozilla
css modifications are disabled in Firefox. You need to make sure that on the <code>about:config</code> page in Firefox, the <code>toolkit. legacyUserProfileCustomizations. stylesheets</code> preference is set to <code>true</code> and then restart the browser.
Simply right click and click Inspect Element. This will bring up the CSS selectors for that element.
Sorry, I know your question is quite old, but it showed up on a google query I had for the same problem.
According to this link (https://developer.mozilla.org/en-US/docs/Web/CSS/@page) it's supported in Firefox since 19.0, which was after your post, just for completeness...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With