Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 396221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:31:50+00:00 2026-05-12T16:31:50+00:00

I am using a separate style-sheet for printing. Is it possible to set right

  • 0

I am using a separate style-sheet for printing.

Is it possible to set right and left margins in the style-sheet which set the print margin? (i.e. margin on paper)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T16:31:50+00:00Added an answer on May 12, 2026 at 4:31 pm

    You should use cm or mm as unit when you specify for printing. Using pixels will cause the browser to translate it to something similar to what it looks like on screen. Using cm or mm will ensure consistent size on the paper.

    body
    {
      margin: 25mm 25mm 25mm 25mm;
    }
    

    For font sizes, use pt for the print media.

    Note that setting the margin on the body in css style will not adjust the margin in the printer driver that defines the printable area of the printer, or margin controlled by the browser (may be adjustable in print preview on some browsers)… It will just set margin on the document inside the printable area.

    You should also be aware that IE7++ automatically adjusts the size to best fit, and causes everything to be wrong even if you use cm or mm. To override this behaviour, the user must select ‘Print preview’ and then set the print size to 100% (default is Shrink To Fit).

    A better option for full control on printed margins is to use the @page directive to set the paper margin, which will affect the margin on paper outside the html body element, which is normally controlled by the browser. See http://www.w3.org/TR/1998/REC-CSS2-19980512/page.html.
    This currently works in all major browsers except Safari.
    In Internet explorer, the margin is actually set to this value in the settings for this printing, and if you do Preview you will get this as default, but the user can change it in the preview.

    @page  
    { 
        size: auto;   /* auto is the initial value */ 
    
        /* this affects the margin in the printer settings */ 
        margin: 25mm 25mm 25mm 25mm;  
    } 
    
    body  
    { 
        /* this affects the margin on the content before sending to printer */ 
        margin: 0px;  
    } 
    

    Related answer:
    Disabling browser print options (headers, footers, margins) from page?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have separate models for Devise users and admins. I am also using Basecamp
Using the Slider Jquery plugin from Egor Khmelev, I've managed to set the slider
I'm wondering if anyone has had any experience modifying print settings via a web
I have a blog-style app that allows users to tag each post with topics.
I'm using the STL string within an application of mine, and I was recently
The HTML5 spec states: Each link created for a link element is handled separately.
Question: Does NFop support floats? Background: I have the requirement to generate a printable
I have a site with index.php in the root folder, images in /img ,
What I want to get is a XSLT template to turn several XML element
The FC++ library provides an interesting approach to supporting functional programming concepts in C++.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.