em vs pixel vs %
- Started
- Last post
- 23 Responses
- svenreed0
i recently started 'reteaching' myself css and html. one of the first things i read from various sources, including qbn, was to use em's and avoid pixels.
also remember, not all users have their fonts set to standard size, some people are reallyyyy old, or just can't see well. hehe.
- Dancer0
I would use em's and do for Font sizes.
But –
for the structure/foundations of a site I still use px. Purely for speed and when I design it in PhotoShop I take all my measurements from there which is in px.... unless someone knows a good way round it?
- nikdaum0
In a related note, has anyone seen how Firefox 3 scales pages. Instead of just the text, the whole page scales up. The size ratios off all elements on the page stay intact.
- PSYKHO0
I always use px for fonts and structure. However I have worked with other designers in the past that used EM's. You can always play around with EM's for font sizes ect but I personally think that you should stick to px for structure and EM for font sizes ect.
Check this conversion table so you can get an idea about size:
http://sureshjain.wordpress.com/…
- Fariska0
I use px for structure and spaces
while i set the text in EMs, to assure a correct scalability/resize-ability throughout all the browsers.
- allworknosleep0
I just finished my first website using all em instead of pixels.. it can become a bit tricky but its definitely worth it.
- nocomply0
Obviously I try to avoid px because it does not scale in IE 6 and IE 7.
IE 6 and below have problems smoothly scaling font sizes in ems.
so here's what i do:
html {font-size: 100%;}
body {font-size: .75em;}
This sets the default font-size in most browsers to about the same as 12px.
From there I set the font size in divs using ems as necessary. For example to make the font in a side-column looks more like 11px I would do something like:
#side_column {font-size:.92em;}
- nocomply0
In all honesty though, don't listen to me...get it from the source:
- Mojo0
this probably isn't helpful, but it depends.
- Chazolta0
px
- d_rek0
Yeah, depends on if you're making a fluid or static page... percentages are good for fluid, pixels are good for static or keeping things consistent, and I still cant' figure out why they let you use EMs when designing for the web...
- JG_LB0
I usually go with pixel because most people I ask don't know what em's are...
- Milan0
pixels
- TheBlueOne0
I bounce between pixels or ems depending on the design and my mood...
- ephix0
why dont know about em? is it the same as pt?
- Milan0
browser text-size increase should never be used anyway, as it completely breaks the layout in any site... "blind" people should use zoom instead
- if it breaks the layout then you're doing it wrongacescence
- sorry not trying to sound mean!acescence
- There are times when text-size increase is good, and there are ways to avoid breaking the layout.ismith
- i agree. if a layout breaks upon text-size increase, then it's probably not coded properly...nearestexit
- at least in terms of accessibility.nearestexit
- Yeah, make your site resize gracefullyyaphi
- ismith0
I almost always use EM, but I find myself using pixels as well. Never percents.
- trooper0
body{font-size:62.5%} = 10px or 1em - work it out from there ;)
- airey0
there needs to be rappers called all 3 of these names. then this thread would be tre-cool instead of uber-nerd. i hope in the next life i'm not an uber-nerd. if anyone's listening up or down there!