SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru Zygoma's Avatar
    Join Date
    May 2006
    Location
    York, Uk
    Posts
    916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    EMs or pixels for spacing?

    Bungiorno from 2 degrees C wetherby UK

    On this site http://tutorial.davidclick.com/2menu.html & illustrated here http://i216.photobucket.com/albums/c...psf33b2cfc.jpg Ive creayed spoacing between the two paragraphs using EMS. Is this a better practice than using pixels?

    Thanks in advance,
    David
    I have had a perfectly wonderful
    evening, but this wasn't it-
    Julius "GROUCHO" Marx - 1890-1977
    http://www.davidclick.com

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,367
    Mentioned
    180 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by Zygoma View Post
    Bungiorno from 2 degrees C wetherby UK

    On this site http://tutorial.davidclick.com/2menu.html & illustrated here http://i216.photobucket.com/albums/c...psf33b2cfc.jpg Ive creayed spoacing between the two paragraphs using EMS. Is this a better practice than using pixels?

    Thanks in advance,
    David
    I mostly use ems for vertical margins on elements like p elements and headings but would not use them for for horizontal margins because the margin would be different depending on the font size of the element so they would never align in a straight line. The benefit of ems for vertical margins is that the bigger the text then the bigger the gap is proportionately.

    When using ems for containers like divs you must ensure they are all the same font-size to start with then otherwise horizontal em margins would be of no use as they would not line up either.


Bookmarks

Posting Permissions

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