-
Notifications
You must be signed in to change notification settings - Fork 4
CSS adjustments for inline sidenotes #86
Description
ppgen currently supports two kinds of sidnotes, normal or standalone, and inline. The former use the .sn directive, the latter use the <sn> inline markup tag. Standalong sidenotes use the "sidenote" CSS class, while inline sidenotes use "sni".
I need to correct a problem with inline sidenotes in HTML, as they end up enclosed inside their container. That is, if they are within a paragraph that is indented from the left margin (say, a block quote) they are also indented instead of being aligned with other sidenotes. Or, if they are within a ".nf b" (poetry, for example) they are fully contained within the margins of the poetry line, and interfere with the text. Similar things happen with tables.
Current CSS, derived from Charlie Howard's Sidenotes article in the
DP Wiki ( http://www.pgdp.net/wiki/Sidenotes ):
.sidenote, .sni { text-indent: 0; text-align: left; width: 9em; min-width: 9em;
max-width: 9em; padding-bottom: .1em; padding-top: .1em;
padding-left: .3em; padding-right: .3em; margin-right: 3.5em; float: left;
clear: left; margin-top: 0em; margin-bottom: 0em; font-size: small;
color: black; background-color: #eeeeee; border: thin dotted gray;
font-style: normal; font-weight: normal; font-variant: normal;
letter-spacing: 0em; text-decoration: none; }
@media handheld { .sidenote, .sni { float: left; clear: none; font-weight: bold; }}
.sni { text-indent: -.2em; }
.hidev { visibility: hidden; }
I have a demonstration of several of the problems on Dropbox,
https://dl.dropboxusercontent.com/u/3229599/ppgt138i.html
In that demo, the top part of the display (before the horizontal rule) uses sidenotes defined as above. Note that the stand-alone sidenote, and the First Sidenote look good. But the Second Sidenote is indented along with the paragraph that contains it.
In the poem the sidenote is within the poem itself, offsetting the lines.
In the table the sidenotes reside within each cell.
The sidenote on Footnote 1 is indented, and does not match the stand-alone sidenote for positioning.
The part below the horizontal rule uses sidenotes that specify a PPer-provided class, and the CSS for that class specifies {position: absolute; left: 8%;} (8% chosen to match up with the stand-alone sidenotes which are at the left margin, defined by ppgen as 8% for the body).
In the second part, to me, the sidenotes in the poem and in the table look good. However, the sidenotes in any kind of paragraph, or in a footnote, end up overlaying text.
So, position:absolute appears to work as a solution for sidenotes in poems and in tables, at least for browsers. I have not tried an epub/mobi test yet. But position absolute is a disaster for footnotes associated with paragraphs or footnotes.
Some questions:
- Will position:absolute cause a problem with epub/mobi?
- For indented paragraphs (block quotes) and footnotes, what would I need to generate to (a) break out of the containing element and (b) not overlay text in the containing element since, obviously, the use of position:absolute does not work well.
Any ideas?
Thanks,
Walt