How to converse em to px and vice sersa

C
Posted By
craigcosmo
Sep 20, 2008
Views
429
Replies
8
Status
Closed

1. how to converse em to px and vice versa ?

2.How to create a background measured in em ?

How to Master Sharpening in Photoshop

Give your photos a professional finish with sharpening in Photoshop. Learn to enhance details, create contrast, and prepare your images for print, web, and social media.

P
Phosphor
Sep 20, 2008
Aren’t em measurements relative measurements? I’m not sure a straight conversion is possible; wouldn’t it depend on the resolution of the image?

Maybe I’m way off base here.
BC
Bart_Cross
Sep 20, 2008
em is a typographic term that refers to font width and is relative to the particular font. Why do you think you need to use this measurement?
P
Phosphor
Sep 20, 2008
It’s used as a measurement in CSS. Distances measured in relation to font sizes I believe.

A little out of my depth here.
M
Mylenium
Sep 21, 2008

1. how to converse em to px and vice versa ? 2. How to create a background
measured in em ?

The straight answer to both questions is "No". Assuming you indeed need this for web output, you have some serious reading up to do. Backgrounds can only be defined in percentages or absolute pixel values. The "em" measurement applies to any dynamically rendered page element that is able to inherit measurements – tables, text, divs, form controls and a few others, but not pixel images. However, even though it is used widespread, it is considered "bad style" as the output will look drastically different in every browser and severely may impair usability and accessibility (e.g. some elements could be rendered off-screen or become so small, they can’t be clicked). Therefore any sizes should be entered in pixels, points or percentages, or, where it applies, in the old-style fixed size increments (small, big, +1, +2,-1,-2 and so on).

Mylenium
DM
Don_McCahill
Sep 22, 2008
Em should only be used for type and spacing (margin, border, and padding in CSS). Images should always be specified for the web in pixel measurements.
P
Phosphor
Sep 22, 2008
"Images should always be specified for the web in pixel measurements."

Is there any other way to specify an image’s size on the web? I don’t know of any…
DM
dave_milbutucci
Sep 22, 2008
Is there any other way to specify an image’s size on the web? I don’t know of any…

pixels or percent.

<http://msdn.microsoft.com/en-us/library/ms535145(VS.85).aspx>
P
Phosphor
Sep 22, 2008
"percent"

Ahhh…good point. I so rarely use percentage as a specifier, because I know it’s smartest to optimize the size of any image to exactly what I want it to be before ever uploading it.

How to Master Sharpening in Photoshop

Give your photos a professional finish with sharpening in Photoshop. Learn to enhance details, create contrast, and prepare your images for print, web, and social media.

Related Discussion Topics

Nice and short text about related topics in discussion sections