Jump to content


Photo

calculating the difference in ems, and px's


  • Please log in to reply
11 replies to this topic

#1 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 13 October 2006 - 02:56 PM

I have a certain number of pixels, say I want to decide how many em's that is instead, is there a way for me to calculate that?

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#2 jcombs_31

jcombs_31
  • Staff Alumni
  • Advanced Member
  • 2,066 posts
  • LocationFL

Posted 13 October 2006 - 03:57 PM

what would be the point, they are different sets of measurements for a reason.

#3 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 13 October 2006 - 03:59 PM

I have an image that is done in pixels, the photoshop file is in pixel's, I am trying my hand at a layout using mostly em's, the pictures have to remain closely the same sizes.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 13 October 2006 - 04:01 PM

1em is about 16pixels.

#5 jcombs_31

jcombs_31
  • Staff Alumni
  • Advanced Member
  • 2,066 posts
  • LocationFL

Posted 13 October 2006 - 04:44 PM

If you are trying to make something pixel peferct, than use pixels, that's why they are a form of measurement. Use ems where appropriate.

#6 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 13 October 2006 - 05:06 PM

Use percentages instead.

#7 jcombs_31

jcombs_31
  • Staff Alumni
  • Advanced Member
  • 2,066 posts
  • LocationFL

Posted 13 October 2006 - 05:37 PM

you guys completely defy logic. 

#8 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 13 October 2006 - 06:08 PM

Agreed.  Use the appropriate measurement.  End of story.

Info: PHP Manual


#9 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 13 October 2006 - 07:50 PM

An em is the size of the font, therefore it can change. A pixel does not.
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#10 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 13 October 2006 - 07:56 PM

Ok, which measurements, should be used for which types of elements.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#11 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 13 October 2006 - 07:57 PM

specifically, and hopefully to draw the curtains down, 'em' is the width (in pixels) of the letter 'M' (caps) for the particular font you're using, hence them name 'em'. so as stated by effigy, it changes with the font.

edit: in response to your post whilst i was typing mine - i've personally never used anything other than pixels and percentages. as for the others? i guess i'll know when to use them when i get to that stage.
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#12 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 13 October 2006 - 10:48 PM

Read it all. Learn a lot. -> http://clagnut.com/blog/348/
Legend has it that reading the manual never killed anyone.
My site




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users