Set Page to Print on A4 paper

Posted on 2006-05-13
Last Modified: 2008-03-17
How do I set a page to print on A4 paper.
I'm using CSS to generate plain text versions of my pages. Problem is, One half ends up on one page the other half ends up on another page.
How do I get the page to fit precisely on a a4 page?
Question by:dpinto04
    1 Comment

    Accepted Solution

    Add a print stylesheet to your page with this line inside your <head> section
    <link rel="stylesheet" type="text/css" media="print" href="print.css" />

    And in print.css:

    html, body, table, h1, h2, h3, h4, h5, h6, p { width: 100%; margin: 2em; }

    That should format your page so it scales to the size of the paper. If you've used layout tables the solution will be more complicated, if you post a link to your page I can give you a more comprehensive answer.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
    Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
    In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now