views:

42

answers:

1

Should not i use any relative measurement in css for any element if i need fixed width, pixel perfect design?

would it be better to use px always?

+1  A: 

If you need a pixel-perfect design (which is a silly goal) then definitely use pixels for the sizing of all elements - i.e. width, height, margin, padding. That's what most developers do anyway.

However you will never get a pixel-perfect design where fonts are concerned. Different operating systems have different fonts and there will always be minor cross-browser differences. So you can use either px or em for font sizes, whatever is easiest in your situation.

DisgruntledGoat
you mean if i use Arial 12 PX font then it will look different in various browser and operating systems
metal-gear-solid
Correct - because my computer doesn't even have Arial so it will use a different sans-serif font.
Stephen P