Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Cincinnati, OH
    Posts
    545
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How many ems in a px?

    I many ems are there say in a px or in? Does someone have a good link on measurements too?

    Thanks

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    185
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ems are an old printer's term. 1em is about the space taken up by the letter "M" in whatever font you happen to be using. So it will change based on the font family and font size in use.

    Double the font size and you roughly double the width of the em. At least on Mozilla, if you have a DIV full of text with a width set in ems, the DIV will get widen when you increase the text size from the menu bar, giving a nice zoom effect.

    I've found ems useful for text-heavy content. A width of 20em fits about 40 characters per line in most fonts, which gives means about 10 or 12 words per line. Change the font and the layout adjusts accordingly so you still get the same 10 or 12 words per line.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Cincinnati, OH
    Posts
    545
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the info. I am trying to create a printable page that will look like a report when printed from a browser. Everything is set using css and alot of the refs for css I use, usually use ems instead of pxs.

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Posts
    185
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Did you know that you can specify style rules for certain media types?

    /* default */
    body {
    background-color: #ffff00; /* yellow text on a black background */
    color: #ffffff;
    }

    /* for printing */
    @media print {

    body {
    background-color: #ffffff; /* black text on a white background */
    color: #000000;
    }
    }

    I've found this extremely useful for making pages print nicely without having to make separate pages just for prints.

    These links might be helpful:

    http://www.w3.org/TR/CSS21/media.html
    http://www.w3.org/TR/CSS21/syndata.html#values

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    Cincinnati, OH
    Posts
    545
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That is excellent. It took me half the time it thought it would. Have you ever been able to get rid of the url and date on the bottom of the page when printing?

  • #6
    New to the CF scene
    Join Date
    Nov 2002
    Location
    Cracow, Poland
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi !
    Just open menu File|Page settings in your browser ( this is example from IE 5.5 ) and set empty field for footer.
    or change key HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\PageSetup\footer in your registry.

    Pawe³.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •