Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are CSS Element dimensions in EM still contemporary?

I still use EM's in the CSS to specify the sizes of elements in my templates.

Today most browsers are able to correctly scale websites where the sizes are given in PX.

My argument for using EM's was / is: if a person that has a sight disability and changes the base font size in the browser, the design still fits.

I'm asking because for me its still a source of errors to use EM's. When i specify a different font-size then the base font-size on a element, I often forget to adapt my EM calculation for the children elements.

Now i have 2 questions:

  1. How do people with a sight disability configure the browser (do they use the browser zoom or do they still change the base font-size)?

  2. Does it still make sense to use EM's for element sizes nowadays?

like image 739
meo Avatar asked Feb 27 '11 15:02

meo


2 Answers

  1. Based on what I've read, neither. Users with mild-to-moderate sight difficulties often use applications distinct from the UA itself to provide zooming functions. These tools can magnify all or part of a display, but (in my limited experience) they don't zoom the text out-of-relation to the setting.

  2. It still makes sense to use 'em'. First of all, accessibility isn't the only reason to use 'ems'. I think the inheritance model of relative sizes makes more sense with ems and percentages than it does with pixels. Second, you can do calculations in CSS3 itself, if it helps you to not need to remember to adapt your calculations.

refs:

  • http://www.championinternet.com/rwa/Ann.pdf
  • http://davidbcalhoun.com/2010/does-it-still-make-sense-to-use-em-rather-than-px
  • http://www.w3.org/TR/css3-values/#calc
like image 140
kojiro Avatar answered Nov 16 '22 14:11

kojiro


Physical dimensions (px) are generally worse than logical (pt, em, %) because physical devices' size and resolution may vary wildly (from a small handset to a desktop screen to a wall-mounted plasma screen). Unless you're tightly bound to a piece of raster graphics, there should not be any disadvantage in specifying dimensions in logical units.

If you always specify font sizes as percent of base size, it's harder to forget to use the logical units :) Also a user can just specify base font size in the browser and your entire design adapts automatically.

When font size is too small for me to read, I zoom a little. Also I specify quite large base size for Japanese pages so that I can make out the glyphs. But if a page resists to adapt to font change, I usually just hit my 'Readability' bookmarklet, and the offending design disappears completely.

like image 38
9000 Avatar answered Nov 16 '22 16:11

9000