![]() |
#1 |
Enthusiast
![]() ![]() Posts: 49
Karma: 102
Join Date: Sep 2010
Location: 52.88504N 06.85904E
Device: PC
|
Fontsize independent text width
For a particular book, I have a style sheet that defines:
p { font-family: Arial, "sans-serif"; font-size: 21pt; margin-left: 2.7em; margin-right: 2.7em; text-align: left; } I also have a version with smaller font size: p { font-family: Arial, "sans-serif"; font-size: 18pt; margin-left: 5.1em; margin-right: 5.1em; text-align: left; } In either version, the word breaks of the text are at exactly the same places. In other words, the page looks exactly the same in both versions except for the size (and margins). To make the style settings independent of the font size, I want to use max-width instead of margin-right. Some experimenting reveals that I have to use max-width: 26.4em for the 21pt version, and 26.9em for the 18pt version. This is surprising, since I'd expect exactly the same value for both versions. max-width is expressed in terms of em so it should be independent of the font size. 0.5em difference is just too much to ignore. What am I missing in the calculations? |
![]() |
![]() |
![]() |
#2 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,046
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
|
|
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Flightcrew : is px for the height/width forbidden ? | NicolasR | Sigil | 2 | 02-11-2011 03:51 AM |
PRS-300 Fixed-width fonts for text files. | seanhennessy | Sony Reader | 0 | 09-24-2010 11:41 AM |
Page Width | kobo2010 | Kobo Reader | 4 | 05-10-2010 08:14 PM |
Using the width attribute | crutledge | Workshop | 8 | 07-06-2009 05:10 AM |
Centering and adjusting the width of a block | Jellby | ePub | 3 | 04-09-2009 12:38 PM |