|
Prev: Padding and bordered not visible in Internet Explorer 7: why?
Next: (www.gobtrade.com) New products to be sold,nike,adidas,bag
From: Jukka K. Korpela on 19 Jan 2008 09:16 Sub titulo Re: vertical-align scripsit GTalbot: > I am going to suggest you, like Dorayme has already twice, to avoid > using line-height: you should *not* be using line-height anywhere at > all in your webpage. I have been coding and creating webpages since > 1997 and I have never used line-height and do not intend to. On the very contrary, authors should _routinely_ include a rule like * { line-height: 1.3; } using a suitable value (a unitless number, which here by definition is a value with the current font size as its implied unit). The value should be selected so that it is reasonable for the font(s) suggested by the author; typically, 1.3 is OK for Arial, and for serif fonts, you might use a somewhat smaller value. And naturally you need to consider the effect of different font suggestions, overriding this basic rule as appropriate for individual elements. The default for line-height is not defined in CSS specifications, the "suggested" values are quite different in differents specs, the browser defaults vary (and are largely undocumented), and one line-height cannot fit all fonts. This is a good reason to set it. One of the most common simple flaws (not so simple to see, obviously, but simple to fix) on web pages is the use of a sans-serif font with large x-height and with a fairly large text width (line length). Unless line-height is set to a reasonable value, the text lines are too close to each other, for readability and for esthetics. If Verdana (gasp) or Tahoma is used, you may even see descenders slashing some ascenders and diacritic marks on the next line. > Another argument is that there are many bugs in IE 6 regarding line- > height and there are some still left in IE 7 regarding line-height. Like what? In reality, the rule I suggest (with any reasonable value - the specific value does not matter here) is a powerful weapon against some nasty IE bugs (which have nothing to do with line-height, really; this just happens to work against them). But, of course, line-height is not a reasonable way to deal with vertical alignment! (_If_ you use vertical-align, then you _may_ need to consider line-height issues with special care, but that's a different story.) -- Jukka K. Korpela ("Yucca") http://www.cs.tut.fi/~jkorpela/
From: dorayme on 19 Jan 2008 12:10 In article <cDnkj.283176$QC3.193059(a)reader1.news.saunalahti.fi>, "Jukka K. Korpela" <jkorpela(a)cs.tut.fi> wrote: > Sub titulo Re: vertical-align > scripsit GTalbot: > > > I am going to suggest you, like Dorayme has already twice, to avoid > > using line-height: you should *not* be using line-height anywhere at > > all in your webpage. I have been coding and creating webpages since > > 1997 and I have never used line-height and do not intend to. > > On the very contrary, authors should _routinely_ include a rule like > * { line-height: 1.3; } > using a suitable value (a unitless number, which here by definition is a > value with the current font size as its implied unit). The value should > be selected so that it is reasonable for the font(s) suggested by the > author;... This is fair enough and an interesting point which you have made before and not something I have ever forgotten (amazingly). But I am sure you would not disagree that people should be *careful* about jumping in to various bits of the CSS and setting line-height and especially setting it with a unit (the OP used px) to try to solve some problem. -- dorayme
From: GTalbot on 23 Jan 2008 04:07
On 19 jan, 09:16, "Jukka K. Korpela" <jkorp...(a)cs.tut.fi> wrote: > Sub titulo Re: vertical-align > On the very contrary, authors should _routinely_ include a rule like > * { line-height: 1.3; } > using a suitable value (a unitless number, which here by definition is a > value with the current font size as its implied unit). The value should > be selected so that it is reasonable for the font(s) suggested by the > author; typically, 1.3 is OK for Arial, and for serif fonts, you might > use a somewhat smaller value. And naturally you need to consider the > effect of different font suggestions, overriding this basic rule as > appropriate for individual elements. [snipped] Jukka, I barely had time to skim over your post. I will reply to it a bit later. Swamped with things to do. And IE 8 with that compatibility switch.. Regards, Gérard |