![]() |
#1 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 813
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
|
CSS margin instead of margin-top, etc.
I don't usually convert ebooks with Calibre, but every once in a while it solves a problem for me, fast. I did an epub to epub conversion recently, and I noticed that instead of margin-top, margin-bottom, margin-left and margin-right in the CSS, I now see one single margin property or class (or whatever it's called), which I HATE. Is there a setting somewhere that will force Calibre to use margin-top, margin-left, etc. when converting? Apologies if this has been covered previously, but I couldn't find anything about it. A link to another thread would be fine. Thanks.
|
![]() |
![]() |
![]() |
#2 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,880
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
is the short form version I have never seen Calibre use that in calibre# styles. I tend to use those to show I have edited a conversion I also don't believe Calibre ever changed a defined class that DID ise the short form. The form is easy to remember margin: 1em =All margins are 1em margin: 1em 2em = top and bottom 1 em, right and left 2em margin: 1em 16pt 1em 2pt; =(top, right, bottom, left) Clockwise starting at the top |
|
![]() |
![]() |
![]() |
#3 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,698
Karma: 16542228
Join Date: Feb 2010
Location: Pennsylvania
Device: Huawei MediaPad M5, LG V30, Boyue T80S, Nexus 7 LTE, K3 3G, Fire HD8
|
Quote:
EPUB/AZW3 Output: Use shorthand forms for margin, padding and border CSS properties, where possible |
|
![]() |
![]() |
![]() |
#4 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,880
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
I have not yet done/fine tuned a 1.4+ conversion To me they are the same and produce a shorter MULTI-LINE, but still easy-to-read CSS |
|
![]() |
![]() |
![]() |
#5 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,698
Karma: 16542228
Join Date: Feb 2010
Location: Pennsylvania
Device: Huawei MediaPad M5, LG V30, Boyue T80S, Nexus 7 LTE, K3 3G, Fire HD8
|
I've never liked the short version because I could never remember what was where. But I think I can remember what you said above - (top, right, bottom, left) Clockwise starting at the top
|
![]() |
![]() |
![]() |
#6 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 813
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
|
There is also a version with 3. So we have:
•margin:10px 5px 15px 20px - top, right, bottom, left •margin:10px 5px 15px - top, right & left, bottom •margin:10px 5px - top & bottom, right & left •margin:10px - all margins I can NEVER remember these, and have to look it up every time. Is there any way to get Calibre to use separate top-margin, right-margin, etc.? |
![]() |
![]() |
![]() |
#7 |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,888
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
|
![]() |
![]() |
![]() |
#8 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 813
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
|
|
![]() |
![]() |
![]() |
#9 |
Zennist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,022
Karma: 47809468
Join Date: Jul 2010
Device: iPod Touch, Sony PRS-350, Nook HD+ & HD
|
I also find the new way margins are specified makes it harder to edit a stylesheet. The convention of having a variable number of values is very confusing and I would not have known what they meant if I hadn't seen this post. I cannot remember them easily either.
If possible, a tweak to use the older style would be appreciated. --Pat |
![]() |
![]() |
![]() |
#10 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 813
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
|
Just received a notice that the ability to choose separate margin properties will be in this Friday's Calibre release. Thank you, Kovid!
|
![]() |
![]() |
![]() |
#11 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,698
Karma: 16542228
Join Date: Feb 2010
Location: Pennsylvania
Device: Huawei MediaPad M5, LG V30, Boyue T80S, Nexus 7 LTE, K3 3G, Fire HD8
|
|
![]() |
![]() |
![]() |
#12 |
Zennist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,022
Karma: 47809468
Join Date: Jul 2010
Device: iPod Touch, Sony PRS-350, Nook HD+ & HD
|
TYVM, Kovid. Hope you had a wonderful vacation.
|
![]() |
![]() |
![]() |
#13 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,162
Karma: 8800000
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
|
Quote:
Maybe the long form should be set as the default. bernie |
|
![]() |
![]() |
![]() |
#14 |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,888
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
Either version of setting margins is perfectly acceptable standard html. I highly doubt that the Nook has problems with standard html code. Exactly why do you think there is a problem?
It would be interesting to hear what your tests reveal. Six of one half a dozen of the other. Both versions are absolutely standard html. |
![]() |
![]() |
![]() |
#15 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,880
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
@gbm
using the short form has to be done correctly (precisely on many fussy devices ![]() ![]() |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
margin-top not applying for paragraphs | marqpdx | Conversion | 1 | 07-26-2012 12:38 AM |
margin top, bottom, additive or not ? | cybmole | Conversion | 5 | 02-16-2011 12:33 PM |
@page { margin-bottom: 5.000000pt; margin-top: 5.000000pt; } | cybmole | Conversion | 15 | 02-12-2011 11:57 AM |
Top Margin in epub | penguintri | ePub | 8 | 05-08-2010 08:37 PM |
calibre ignore margin-top and margin-bottom | bender | Calibre | 2 | 12-11-2009 06:58 AM |