px or %

Use px if you want a fixed setting, use % if you want it to accomodate changes.

I use % in my image positioning divs, as images may not be the same size, so the % way accomodates for this :)
 
for accessibility, work in ems and %. i happen to like my websites looking a certain way, so i px everything - unless told otherwise
 
I've not read that before, em's being better etc.

I've only ever worked on one website that requried me to use %. In the end it didn't go live :o :eek: :p
 
Whatever the layout requires, but for me it's almost exclusively px, em and % and usually a combination of all three.

As a basic rule:
  • If I need something fixed, I use px - sidebar columns, headers, graphics etc. Classic example - 760px width container.
  • If I need something to scale proportionately I use ems e.g. all text, text containers, anything that needs to scale proportionately to text.
  • % values for either components of fluid layouts where I just want something to roughly span an area e.g. two columns in a container 50% width each, or where something needs to be scaled as a multiple of something else e.g. 200% font-sizing.
 
Back
Top Bottom