new layout on wiki4d

Stewart Gordon smjg_1998 at yahoo.com
Fri Jun 4 09:38:10 PDT 2010


Jérôme M. Berger wrote:
> Stewart Gordon wrote:
>> Matthias Pleh wrote:
>>> I have renewed the layout of the wiki4d-site.
>>> It's not finished, but I think it is already useable!
>>> Content itself hasn't changed!
>>>
>>> Any thoughts?
>> <snip>
>>
>> Get rid of the abomination that is font sizes in px!  Specify them in em
>> or, even better, not at all.
>>
> 	I agree that font sizes in px is an abomination, but font sizes in
> em is just plain ridiculous since 1em is defined in terms of the
> font size!

Not quite.
http://www.w3.org/TR/2009/CR-CSS2-20090908/syndata.html#length-units

"The 'em' unit is equal to the computed value of the 'font-size' 
property of the element on which it is used. The exception is when 'em' 
occurs in the value of the 'font-size' property itself, in which case it 
refers to the font size of the parent element. It may be used for 
vertical or horizontal measurement. (This unit is also sometimes called 
the quad-width in typographic texts.)"

> Use either pt (which should work if the os/browser is
> configured properly), percents, or the keywords (x-large, large,
> normal, small, x-small).

By suggesting pt, you have contradicted the point I was making.  The 
point is _not_ to inflict a fixed size.

No size specified
Pros: Conforms to the size setting that the user has set for his/her comfort
Cons: Some fonts look bigger or smaller at the same point size than the 
default Times New Roman, so the ideal size is dependent on the font

Size in em
Pros: Always scales to the user's font size setting.  Can be used to 
compensate for the aforementioned relative sizes of different fonts.
Cons: If used on body text, it's still annoying if you change the size 
significantly from the default.  Maintaining font sizes of elements 
relative to each other can get complicated.

Size keywords
Pros: Easy to maintain since you don't have to worry about how relative 
sizes work.  Zooms correctly in browsers.
Cons: Those of em, plus it's coarse-grained.

Size in pt
Cons: Those of em, plus in some broken browsers (such as IE) it 
overrides the text size/zoom option.

Size in px
Cons: All those of pt, plus works against the ability to change the 
system font scale.


But you can use em without it becoming too complicated.  All you need to 
do is:
- understand how em works (it's actually quite simple - see the quoted 
paragraph above)
- if you must change the body text size, do it by just setting it for 
the body element
- keep the font size scheme generally as simple as you can get away with

Stewart.


More information about the Digitalmars-d-announce mailing list