View Single Post
Old 09-26-2012, 04:48 AM   #2
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
That is tricky, and whatever solution you find is bound to fail in some cases, particularly with a narrow screen or large font size (what would be the desired result if, for example, the screen is just wide enough to fit "This is a first line"? A blank line?)

The immediate solution is repeating the first line, but with a "visibility: hidden" style. But the "visibility" property is not included in the ePub 2.1 standard, which means readers are not required to support it... and just image what would happen if a reader doesn't.

Another possible solution would be to give it a white text color... but that of course would only work if the background is white, which cannot be assumed.

It has just occurred to me that maybe this works: "position: relative; right: 200%;" It should effectively move the "invisible" part out of the screen. In any case, these tricks rely on having the text repeated, which will break as soon as the CSS is ignored or not supported.

Maybe it's safer to have "This is a first line" only once, but moved up from its natural place (with "position: relative"), but that would be tricky again if you don't know the line spacing, and may be hard to get right in all circumstances.

At the end of the story, the only really safe solution is simply assigning a large arbitrary right margin to the second part of the verse, forget about getting exact alignment with the first part and trust the reader (the person) to understand it.
Jellby is offline   Reply With Quote