![]() |
#1 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Jul 2011
Location: Austria
Device: Sony PRS-T1
|
Suppress indentation of first paragraph
Hi,
I often convert from epub to epub to remove spacing between paragraphs and set the text justification to "justified". It works fine, but I have not found a way to suppress the indentation of the first paragraph. I have tried to specify an "Extra CSS": p:first-child {text-indent: 0pt;} but it seems to have no effect in the generated output. I would be very thankful for any hints. Thanks in advance, Behnam |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
I think that isn't working because the first-child of the parent is probably a heading. Or at least that is my reading of the definition.
What I use to achieve what you want is: h2 + p , h4 + p, hr + p {text-indent:0} The exact heading levels and hr might get adjusted for different books but that works. |
![]() |
![]() |
![]() |
#3 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Jul 2011
Location: Austria
Device: Sony PRS-T1
|
Thank you davidfor for your answer.
You're right: My initial attempt with "p:first-child" would work only in cases where all paragraphs are inside an enclosing element like "div", which is not always the case. Based on your solution with adjacent siblings (and after some experiments) I finally get good results with the following: "Remove spacing between paragraphs" (checked) "Indent size" (set to "No change") Extra CSS: p {text-indent: 0} p + p {text-indent: 1.5em} Setting the indent size in the dialog box to "No change" seems to be essential, otherwise the given value will override the value given in the extra CSS. |
![]() |
![]() |
![]() |
#4 | ||
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,889
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
Quote:
![]() Quote:
Good Reading. |
||
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Suggestion] Change indentation to one letter per indentation level. | John Peterson | Development | 1 | 10-22-2012 02:05 PM |
Preference: Paragraph indent or a little paragraph spacing? | 1611mac | General Discussions | 48 | 11-11-2011 12:43 AM |
control blockquote indentation | bobb40 | Conversion | 9 | 08-10-2011 05:04 AM |
Preserving Indentation | zaph0d | Conversion | 5 | 05-30-2011 04:41 PM |
Epub and negative indentation | Nate the great | ePub | 6 | 04-27-2009 11:48 AM |