![]() |
#1 |
Member
![]() Posts: 23
Karma: 10
Join Date: May 2024
Device: Clara 2E
|
CSS command instead of remove spacing between paragraphs
Hi everybody, is this code correct to use instead of the "remove spacing between paragraphs" in calibre or would there be some other problems created with it:
p { margin: 0 !important; padding: 0; } It looks great so far and there are no bugs found by calibre after converting. Thanks a lot for the help. |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,592
Karma: 9499994
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
https://www2.mobileread.com/i/mr/editor/menupop.gif
I don't think you need the !important.
For the standard paragraph, I use... p { display: block; margin-top: 0; margin-bottom: 0; text-indent: 1em; } Then, for those paragraphs that don't use an indent I use... .noindent { text-indent: 0; } Also, you need to check the css for the <body> tag in case it needs tweaking. Great that it is slowly coming together for you. What ereader are you using? And if it helps, here is my css in full which I adjust as needed on a per-book basis. Might give you some pointers... https://paste.kodi.tv/rovohaxatu |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Member
![]() Posts: 23
Karma: 10
Join Date: May 2024
Device: Clara 2E
|
Quote:
Thank you. I will try that. I am using a clara 2e. The last reader was a sony prs-t3. It handled my ebooks much better. Don't know why Kobo is so lazy with formatting and such. Are you editing from paragraph to paragraph or just via the conversion tool? |
|
![]() |
![]() |
![]() |
#4 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,592
Karma: 9499994
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
I never use the conversion tool, nor any plugins. I just recode/reformat the entire epub. Main method I use is regex to make bulk fixes
|
![]() |
![]() |
![]() |
#5 | |
Member
![]() Posts: 23
Karma: 10
Join Date: May 2024
Device: Clara 2E
|
Quote:
I have noticed some ebooks had a black font color after the conversion. On the reader they look normal, but not when viewed in calibre (black letters on grey background). Is this a bug, because I use the dark mode on windows or is the css somehow broken? Who noticed this before? |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,592
Karma: 9499994
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
I started this about 4 years ago, and I had no clue on any of that. NO CLUE. You should have seen the mess I made of the first book. But quite a bit of reading, experimenting and it started to sink in. Then came across this forum, and picked up even more pointers from the very helpful members here. Now about 500+ books later, I can do it in my sleep... almost. A somewhat clean book can be fixed within half an hour, but some books are a total mess and can take a few hours. As for having time... what is the rush? Do you have a deadline that requires you to rush these books into distribution? Slow down, understand what it is you are doing, and you will save yourself quite a bit of stress and frustration when things aren't working out. |
|
![]() |
![]() |
![]() |
#7 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,451
Karma: 167726581
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
For what little it may be worth, I use the following for my base body and p CSS:
Code:
body { display: block; font-size: 1em; margin: 0 0 0 0; padding: 0 0 0 0; text-indent: 0; line-height: 1.05; widows: 1; orphans: 1; } p { display: block; text-indent: 0; line-height: 1.05; margin: 0 0 0 0; padding: 0.1em 0 0 0; margin-block-end: 0em; } |
![]() |
![]() |
![]() |
#8 | |
Member
![]() Posts: 23
Karma: 10
Join Date: May 2024
Device: Clara 2E
|
Quote:
|
|
![]() |
![]() |
![]() |
#9 | |
Member
![]() Posts: 23
Karma: 10
Join Date: May 2024
Device: Clara 2E
|
Quote:
|
|
![]() |
![]() |
![]() |
#10 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,914
Karma: 143098300
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Code:
p { margin-top: 0; margin-bottom: 0; widows: 1; orphans: 1; text-indent: 1.2em; } |
|
![]() |
![]() |
![]() |
#11 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,914
Karma: 143098300
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#12 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,914
Karma: 143098300
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Code:
body { widows: 1; orphans: 1; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; text-align: justify; } Last edited by JSWolf; 01-19-2025 at 07:49 PM. |
|
![]() |
![]() |
![]() |
#13 | |
Fool
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 454
Karma: 4103210
Join Date: Feb 2003
Device: Kindle: Voyage,PW1,KOA, Kobo: Clara Colour, Nook GLP, Pocketbook verse
|
Quote:
The reason I think this, although I haven't tried your code, is that many years ago (before Kindles and Kobos had much ability to darken fonts or select really dark fonts) I set my conversions to to the equivalent with font-weight and it worked very well. I originally did *{font-weight:bold} but the results were inconsistent. Kovid suggested that I add !important, and it worked consistently. Of course, I'm a lot less picky than some of the folk on this thread. Good luck. |
|
![]() |
![]() |
![]() |
#14 | |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,451
Karma: 167726581
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
Basically, since ereaders do not modify the line spacing the way that physical books can, you end up with varying gaps at the bottom of a page which the widows/orphans setting helps to reduce. In theory, an ereader could use microjustication (small changes to spacing between words and letters and lines) to make text more even on page but that takes quite a bit of CPU power and memory which most ereaders do not have. Last edited by DNSB; 01-28-2025 at 04:42 PM. Reason: fixed typo that annoyed me everytime I saw it |
|
![]() |
![]() |
![]() |
#15 | |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 517
Karma: 8500000
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe, Kindle 4 Touch
|
Quote:
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
There's no spacing between paragraphs | Tior500 | Conversion | 1 | 12-02-2019 10:18 AM |
CSS to indent paragraphs and remove spaces | Alda | Sigil | 7 | 06-20-2014 05:36 AM |
expression to remove double spacing between paragraphs | ktj | Calibre | 4 | 07-26-2011 02:38 PM |
Remove spacing between paragraphs - what about div tags ? | NASCARaddicted | Calibre | 5 | 11-07-2009 05:47 AM |
Remove spacing between paragraphs doesn't. | Djehuty | Calibre | 6 | 04-28-2009 04:53 AM |