![]() |
#17 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
this is gettign much cleaere - thanks all.
my only remaining CSS puzzle is body vs .body - no joy googling css syntax for explanation of when not to add the dot on the default 5pt margins - just out of curiosity how were they chosen - democratically or Kovid's view of what looks best. If I wanted more margin all around, in the style of some adobe xgpt styles, I guess its better to tweak common preferences & reconvert rather than edit CSS & find /replace the @page stuff; that way there will be an original-epub to revert to. on a quick test, I see the visual appeal of more surrounding white space - it is more "paper book like" but when I am actually reading i like to minimize page turns so will probably stick with calibre defaults. |
![]() |
![]() |
Advert | |
|
![]() |
#18 | |
Reader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 520
Karma: 24612
Join Date: Aug 2009
Location: Utrecht, NL
Device: Kobo Aura 2, iPhone, iPad
|
Quote:
Combined: p.xxxx would apply to elements <p class="xxxx">. |
|
![]() |
![]() |
![]() |
#19 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
Quote:
each page of epub html (before conversion) contains <head> blah blah <body> <p blah blah so does body in css apply to that, or only .body in CSS adding / removing that leading dot in css does change the margins |
|
![]() |
![]() |
![]() |
#20 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
if your css file contains
Code:
.body {margin-left:5pt; ... etc} (with dot) <p class="body"> <div class="body"> <blockquote class="body"> <body class="body"> If your css file contains Code:
body {margin-left:5pt; margin-right:5pt; ... etc} (without dot) <body> it would also affect any text in your html marked up with <body class="xyz"> but with a caveat. If your css also contains Code:
.xyz {margin-left:10pt} If the css contains Code:
body.xyz {margin-left:5pt; margin-right:5pt; ... etc} For your specific epub, it's hard to say more without seeing it. The fact that a typical html file for a chapter only has a plain <body> tag rather than a <body class="calibre??"> suggests it was not created by a Calibre conversion, but I stand to be corrected on that. I manually add those 5pt L/R margins to non-Calibre epubs all the time. I can't say I've noticed any problems. |
![]() |
![]() |
Advert | |
|
![]() |
#21 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
i have no instances of class="body" in the original epub ( which has not come from calibre)
i have just <body> then <h2 chapter header stuff.... then <p class="indent".... stuff and no instances of 5pt margins in either the body or the indent definitions- the relevent bits are: p.indent { text-indent: 1.00em; margin-left: 0em; margin-right: 0em; text-align: justify; } body { margin-left: 0em; margin-right: 0em; } so with those definitions, and your explanation, I'd expect to see text flow right up to bevel - which it does. - TICK I now understand what calibre does, & where it does it, to add 5pt margins - TICK I can also "prove" your explanation of the overrides, by setting e.g. left margin 5em in body to make a big visible difference. body (without dot) then hugely indents the whole chapter. body (with dot) is over-ridden by p.indent & thus has no effect. TICK but a zero left margin in body ( no dot) does not look the same as a zero left margin in p.indent & that is just mystifying - unless it is a side effect of justify... YES. THAT IS IT. if i set p.indent text-align:left; then the text flows right up to left edge and all behaviour is consistent with explanations given: body , with dot, is overridden by p.indent, and the text-align :justify in that definition adds something akin to a 5pt left & right border I'm going tp quit while I think I'm winning & go read something :0) |
![]() |
![]() |
![]() |
#22 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,056
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:
.body only applies to something with the class="body" Both are valid Both can do the same the second way just allows finer application control |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can't seem to change epub margins | Desertway | Calibre | 7 | 01-19-2012 04:28 AM |
Neat solution for a misbehaving reader screen | Tunney | enTourage eDGe | 8 | 12-02-2011 03:07 AM |
Epub to mobi margins.. | Corran006 | Calibre | 0 | 08-27-2010 08:39 PM |
epub vs lrf - why choose epub for sony reader? | Mitchll | Calibre | 25 | 03-11-2010 09:39 PM |
Testing margins in ePUB. | Jellby | Workshop | 8 | 01-03-2010 11:57 AM |