1

I need help coding a poetry book. The book will be available on amazon and readers will be able to change the text size. I need the lines to wrap with a hanging indent if they are longer than the width of the reader's device.

The book is currently set up so that each stanza is its own paragraph and each line has a
at the end of it. How can I ensure that the lines will wrap with a hanging indent? It will be translated into an EPUB document.

All advice is appreciated thank you.

1 Answers1

0

You might try something like this:

.hang {
padding-left: 2em ;
text-indent: -2em ;
}

Notice there is a point / period / full stop before "hang".

Then every other paragraph would be tagged as follows:

<p class="hang">

Or You can try something like this, if You don't mind solving it without CSS:

<p width="-30">First line</p>
<p width="-60">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Second line</p>
<p width="-30">Third line</p>
<p width="-60">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Guess which line</p>
<p width="-30">Next line</p>
<p width="-60">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;And so on</p>

Then there is this topic, and also this one.

Also You can ask it over at Ebooks Stackexchange!

Zsolt Botykai
  • 50,406
  • 14
  • 85
  • 110