SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot Arkkimaagi's Avatar
    Join Date
    Mar 2002
    Location
    Lappeenranta, Finland
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    So, what is em anyways?

    I've heard that em should be used instead of pixel values. I hate percentage values as they do not work with images well. (Well, in my opinion atleast)

    What is this em? What units does it use? Is it of any use anyways? Why should it be any better than other units?

  2. #2
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Arkkimaagi
    I've heard that em should be used instead of pixel values. I hate percentage values as they do not work with images well. (Well, in my opinion atleast)
    well, first of all nobody says that ems should be used for images. images, by definition, are measured in pixels, and that's the way it should be.

    What is this em? What units does it use? Is it of any use anyways? Why should it be any better than other units?
    ems are a typographical unit. 1em corresponds to the normal size that a font was designed for, the normal size your browser would display that font at if you didn't provide any size at all. they work like percentages, in that 1em = 100%, 0.76em = 76% etc

    using ems for font sizing is the same as percentages. however, once you start using it for width, heights, padding, margin etc, it's more useful than percentages as it always refers back to the size of the font you're working with. thus saying that a margin for a block of text is 0.5em means that it's 50% OF THE FONT SIZE. if you used margin:50%, this measure would refer to the width of that particular element instead.
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  3. #3
    SitePoint Zealot Arkkimaagi's Avatar
    Join Date
    Mar 2002
    Location
    Lappeenranta, Finland
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay, so if I set width:5em; what does that do then? Set the width of the area to 5*font height?

  4. #4
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Arkkimaagi
    Okay, so if I set width:5em; what does that do then? Set the width of the area to 5*font height?
    yes
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com


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
  •