|
|
#1 |
|
Enthusiast
![]() Posts: 25
Karma: 10
Join Date: May 2024
Device: Clara 2E
|
Calibre not using my indent command
Hello everybody,
I use this css styling for my epub conversions: p { p:first-of-type { text-indent: 0 !important; } p { margin: 0 !important; padding: 0; widows: 1; orphans: 1; text-indent: 1em !important; } Unfortunately calibre indents with more than 1em for the other paragraphs except the first one. How can I combine the two p commands in one, so that the text indent will be 1em? My goal is that the first indent after chapter or space break is 0 and the normal indent after paragraph should be 1em. Thank you in advance |
|
|
|
|
|
#2 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,701
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
|
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Enthusiast
![]() Posts: 25
Karma: 10
Join Date: May 2024
Device: Clara 2E
|
The thing is I have tinkered around with the curly brackets and it either indented after every paragraph with 1em even after chapter or the first one was not indented but every other had like 2.5em.
Is it ok to have two p commands or does just the first one count and the second one will be of no use to calibre? Also tried this with no luck: p { p:first-of-type { text-indent: 0 !important;} margin: 0 !important; padding: 0; widows: 1; orphans: 1; text-indent: 1em !important; } |
|
|
|
|
|
#4 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,701
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
You can't nest CSS rules as far as I am aware. So your double sets of curly brackets won't work.
Sometimes it is easier to just use basic coding, so I wouldn't be trying to combine rules https://www.w3schools.com/css/css_combinators.asp I would use two separate rules... For all your standard paragraphs, use this for your 1em indent p { display: block; margin-top: 0; margin-bottom: 0; text-indent: 1em; } Then for your first para after scene break, use the following. It will give you spacing above for the scene break. And yes, you will have to modify all the scene break p tags to include the class. <p class="scene">Blah blah.</p> .scene { padding-bottom: 0; padding-top: 2em; text-indent: 0; } If you want to use pseudo elements, they will need to be two separate rules anyway, and not all ereader software will understand it. https://www.w3schools.com/css/css_pseudo_elements.asp |
|
|
|
|
|
#5 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 96
Karma: 118402
Join Date: Jul 2009
Device: Cybook Gen3
|
For me the use of p + p would be the easier solution
Code:
p {
text-indent: 0 !important;
}
p + p {
margin: 0 !important;
padding: 0;
widows: 1;
orphans: 1;
text-indent: 1em !important;
}
|
|
|
|
| Advert | |
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Command line, Adding books also picks up metadata not in command used | droodled | Library Management | 2 | 11-26-2025 10:30 AM |
| Is there a way to execute a non-root command without access to command line | Galunid | Kindle Developer's Corner | 4 | 05-15-2018 08:50 PM |
| Aldiko & Calibre Indent Woe. | Themus | Calibre | 1 | 05-19-2012 05:37 PM |
| Calibre Indent Issue When Removing Blank Lines (Converting From HTML to MOBI or EPUB) | David Derrico | Calibre | 5 | 08-04-2010 01:13 AM |
| calibre command line utilities and calibre defaults | astrodad | Calibre | 2 | 08-07-2008 04:27 PM |