View Single Post
Old 02-13-2012, 11:05 AM   #1
Derek R
Connoisseur
Derek R began at the beginning.
 
Derek R's Avatar
 
Posts: 67
Karma: 20
Join Date: Jun 2011
Location: County Down, Northern Ireland
Device: none
Indents and hanging indents in epub poetry

I have read a number of posts on the issue of creating indented lines and hanging indents in poetry in epubs, but haven't quite managed to find a definitive answer. In experimenting, I have come up with some code using an unordered list that seems to work:

CSS:

ul.poem {list-style-type:none;}
.poem li {text-indent:-2em;}
.indent {margin-left:1em; text-indent:2em;}
.stanza {margin-top:1em;}

HTML:

<ul class="poem">
<li>"Twilight and evening bell,</li>

<li class="indent">And after that the dark!</li>

<li>And may there be no sadness of farewell,</li>

<li class="indent">When I embark.</li>

<li class="stanza">For tho' from out our bourne of time and place</li>

<li class="indent">The flood may bear me far,</li>

<li>I hope to see my Pilot face to face</li>

<li class="indent">When I have crost the bar."</li>
</ul>

This indents the poem from the main body of text, indents every second line, and seems to provide hanging indents when the lines wrap - which is what I have been looking for.

Can anyone see any potential problems with this coding for poetry?

Will the list items automatically inherit the line-height from the rest of the (prose) text, for example?
Derek R is offline   Reply With Quote