Thread: Using PRE tag
View Single Post
Old 06-15-2015, 11:17 PM   #8
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Quote:
Originally Posted by Notjohn View Post
I don't get that effect on my Kindle editions, as viewed in my K3 Keyboard and my Fire HD tablet. I introduce all chapters with a few words in all caps, with this style:

span.smallcap {
font-size: 90%;
font-weight: bold;
}
You're not using the line-height at all in that snippet. The line-height property determines the total height of a line of text relative to the font size—in other words, the height of the font plus the height of the space between lines.

Because you didn't specify the line-height property, the reader uses the default value of 1.2 (120%).

If your reader uses a base font size of 12 pt, then the CSS above specifies a roughly 10.8 point font size, which is a little over 14 pixels. When you multiply that by 1.2, you find that the baseline of each line is about 17 pixels below the baseline of the line before it, resulting in roughly a three pixel spacing between the bottom of a typical descender and the top of a typical ascender in the next line (assuming the font metrics are correct).
dgatwood is offline   Reply With Quote