printer margin in css

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • thomas  hygum

    printer margin in css

    How do I design the printers margins in css, so the user doesn't have
    to change the margins in print preview? So the site looks the same on
    the printer as on the screen.

  • Jukka K. Korpela

    #2
    Re: printer margin in css

    "thomas hygum" <hygum@tigerens rede.dk> wrote:
    [color=blue]
    > How do I design the printers margins in css, so the user doesn't have
    > to change the margins in print preview?[/color]

    You don't. It might be argued that the best margin is no margin (which
    means explicitly setting <html> and <body> margins and paddings to zero),
    because then you don't add anything to margins that the user has specified
    for printing in general. But some small margins, like those we usually use
    on screen (like 0.5em or 1em on the left), probably don't disturb much, and
    the improve the situation in case the user has set zero margins for some
    odd reason.
    [color=blue]
    > So the site looks the same on
    > the printer as on the screen.[/color]

    Can you tell me what size my screen is, and my printer's paper?
    I'm pretty sure you already know that the resolutions are different.
    And it's probably no surprise that people typically use color screens but
    very often print using a black and white printer. So how _could_ they be
    the same? Besides, why _should_ they? What's great in CSS is that you can
    make things _different_ in different environments.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/

    Comment

    • Tim

      #3
      Re: printer margin in css

      "thomas hygum" <hygum@tigerens rede.dk> wrote:
      [color=blue][color=green]
      >> How do I design the printers margins in css, so the user doesn't have
      >> to change the margins in print preview?[/color][/color]

      "Jukka K. Korpela" <jkorpela@cs.tu t.fi> posted:
      [color=blue]
      > You don't. It might be argued that the best margin is no margin (which
      > means explicitly setting <html> and <body> margins and paddings to zero),[/color]

      I'd leave printing alone, but on-screen margins help with readability.
      Some browsers do jam the text along the window borders, with what looks
      like no gap, at all, between the text and the edge.
      [color=blue][color=green]
      >> So the site looks the same on the printer as on the screen.[/color][/color]

      I think most people will have systems like mine, where the page is entirely
      different dimensions than the screen. Both in aspect ratio, and the amount
      of text that can fit across it.

      Then there's the situation where do you really need to clone the page, or
      just print the information that they'll be wanting (e.g. just the article
      content of the page, and omitting all the navigational gumph).

      --
      If you insist on e-mailing me, use the reply-to address (it's real but
      temporary). But please reply to the group, like you're supposed to.

      This message was sent without a virus, please delete some files yourself.

      Comment

      • thomas  hygum

        #4
        Re: printer margin in css

        I want the same look on every machine because what I want to print is
        labels on a special label-paper, where the text has to be precisely
        located. I want to do it in php because the texts come from a database.

        And I can predict the outcome on every screen, because the only margins
        I want to control is top and left, which is nearly always the same. If
        I wanted to control all four margins it were something else.

        Comment

        • Jukka K. Korpela

          #5
          Re: printer margin in css

          "thomas hygum" <hygum@tigerens rede.dk> wrote:
          [color=blue]
          > I want the same look on every machine because what I want to print is
          > labels on a special label-paper, where the text has to be precisely
          > located.[/color]

          So you are not authoring for the WWW (which is what we discuss here), are
          you?
          [color=blue]
          > And I can predict the outcome on every screen,[/color]

          Then you need to study all screens and all browsers used and their
          settings, in every detail. But that's not about WWW, is it?

          P.S. It is recommendable and customary to quote or paraphrase previous
          discussion when posting a followup.

          --
          Yucca, http://www.cs.tut.fi/~jkorpela/

          Comment

          • Dr John Stockton

            #6
            Re: printer margin in css

            JRS: In article <Xns95F14703139 89jkorpelacstut fi@193.229.0.31 >, dated
            Wed, 2 Feb 2005 05:01:28, seen in news:comp.infos ystems.www.authoring.st
            ylesheets, Jukka K. Korpela <jkorpela@cs.tu t.fi> posted :[color=blue]
            >
            >P.S. It is recommendable and customary to quote or paraphrase previous
            >discussion when posting a followup.[/color]

            But he's a Google user, and probably does not know how to.

            ISTM that the newsgroup FAQ could give guidance or a pointer to
            guidance, either at the tail of A.4 after the RFC1855 reference
            paragraph or in A.7a maybe.

            If it covers the matter, something like
            Replies via Google :
            see <http://www.cs.tut.fi/~jkorpela/internet/index.html#anka >
            might suffice.


            Via sig line 3 :
            Chris Croughton posted :
            Keith Thompson wrote in comp.lang.c, message ID <lnwtuhfy7d.fsf @nuthaus.
            mib.org> :-
            If you want to post a followup via groups.google.c om, don't use the
            "Reply" link at the bottom of the article. Click on "show options" at
            the top of the article, then click on the "Reply" at the bottom of the
            article headers.


            Guidance on posting via Google with indentation would also be welcome.

            A.7 could also observe that proper NNTP services and newsreaders are
            better than Web services, and mention news.individual .net.

            --
            © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 MIME ©
            Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
            Web <URL:http://www.merlyn.demo n.co.uk/news-use.htm> : about usage of News.
            No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.

            Comment

            Working...