182

Possible Duplicate:
What means Ems? (Android TextView)

In EditText there is an attribute named android:ems. The description is "Makes the EditText be exactly this many ems wide"

What does ems mean?

Community
  • 1
  • 1
Chirag
  • 56,621
  • 29
  • 151
  • 198
  • I am not confident to put it as an answer.. But user kcoppock's answer in [this](http://stackoverflow.com/questions/4257843/in-android-how-to-create-edittext-of-fixed-width) thread might interest you.. – Krishnabhadra Apr 23 '12 at 05:43
  • same question posted here http://stackoverflow.com/questions/7053738/what-means-ems-android-textview – ankita gahoi Apr 23 '12 at 05:52

2 Answers2

151

Taken from: http://www.w3.org/Style/Examples/007/units:

The em is simply the font size. In an element with a 2in font, 1em thus means 2in. Expressing sizes, such as margins and paddings, in em means they are related to the font size, and if the user has a big font (e.g., on a big screen) or a small font (e.g., on a handheld device), the sizes will be in proportion. Declarations such as 'text-indent: 1.5em' and 'margin: 1em' are extremely common in CSS.

em is basically CSS property for font sizes.

Boris Strandjev
  • 46,145
  • 15
  • 108
  • 135
33

An "em" is a typographical unit of width, the width of a wide-ish letter like "m" pronounced "em". Similarly there is an "en". Similarly "en-dash" and "em-dash" for – and —

-Tim Bray

adneal
  • 30,484
  • 10
  • 122
  • 151
  • I am sorry, I do not know who this Tim is, but the only reference I could find regarding his m-width definition is here: http://en.wikipedia.org/wiki/Em_(typography)#Incorrect_and_alternative_definitions (note the section is called incorrect definitions) – Boris Strandjev Apr 23 '12 at 06:06
  • 3
    Just look him up. [Here's his Wikipedia page](http://en.wikipedia.org/wiki/Tim_Bray), for example. – adneal Apr 23 '12 at 06:27