View Single Post
Old 10-30-2023, 04:46 PM   #10
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,852
Karma: 8821117
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by Lukusaukko View Post
Works in Editor, though, which is a bit strange... Anyway, thanks to all who contributed, I've got it sorted now. Also, note to self: don't try anything too fancy...
Why? Calibre Viewer is a great piece of software, based on one of the latest versions of webkit, and supports the epub3 protocol very well. So, anything "too fancy" also will work on Calibre Viewer. Your issue is that you employed the wrong property; you used "first-line" when you should use "first-child" or "firts-of-type" with the sibling combinator "~". For example:

Code:
div.indented {
  padding: 1em 1.5em 1em 2em;
}

div.indented p {
  margin: 0.5em 0 0.5em 1.5em;
  line-height: 1.2em;
}

div.indented p:first-child {
  text-indent: -1.5em;
}

div.indented p:first-child ~ p {
  text-indent: -1.5em;
}
Watch the epub I attach. And here you can watch how it looks on Calibre Viewer and also on Sigil:

Click image for larger version

Name:	Hanging Text Calibre Viewer.png
Views:	134
Size:	47.3 KB
ID:	204490 Click image for larger version

Name:	Hanging Text Sigil.png
Views:	139
Size:	175.6 KB
ID:	204491

Of course, all that "fancy code" (is not fancy, is trivial) is not neccesary because the effect can be achieved with less code and simpler (as I wrote in my previous post). But I include all this css so you can be sure that Calibre Viewer will support advanced css properties and selectors.
Attached Files
File Type: epub hanging paragraphs.epub (2.8 KB, 84 views)

Last edited by RbnJrg; 10-30-2023 at 04:49 PM.
RbnJrg is offline   Reply With Quote