![]() |
#1 |
The one and only
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,302
Karma: 535819
Join Date: Oct 2008
Location: Berlin, Germany
Device: yup!
|
Solved - marginals in ePub
For a customer I hab to find a solution for marginals in ePub; in this case a theater script with the names of the actors.
Seems like I finally came up with a solution which works as well in ADE as on iBooks as on the Bookeen Opus. ![]() This solution ist limited to the fact that the marginals will only work on the first line of a new parapgraph. Which shouldn't normally be a problem, but I just wanted to mention it. Maybe someone comes up with a solution to place a marginal in the middle of a paragraph. The main text is in paragraphs, the marginal is in a div plus a span (necessary for iBooks to keep the formatting). Right below is a link to the html-file with the CSS and the final ePub. I'm no CSS stylist, so hopefully no web designer will be offended by the code. ![]() It's all in German, just in case. Comments are welcome for sure, especially if this solution works on other devices too! ![]() Basic html: http://www.die-ebook-manufaktur.de/test/marginalien.htm ePub: http://www.die-ebook-manufaktur.de/t...rginalien.epub |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,884
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
At first, That appears to be a 'Hanging Indent' , but closer inspection shows that the rest of the line is part of the normal paragraph block.
I see you used Code:
div.marg {font-size: 1em; float:left; width: 125px; text-align: right; font-style:italic;} ![]() |
![]() |
![]() |
![]() |
#3 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
That looks fine.
But consider that the document might be read in small screens or with large fonts, so maybe: (a) Using absolute units (125px) might not be a good idea. (b) "Wasting" valuable space in the right side just because some name will appear there from time to time might look not so good. For an e-book, I'd probably use some other style, like putting the character names in their own lines (paragraphs), or just writing them in bold, with some space to set them appart from the text. It won't look so pretty, but it can be more readable in a wider variety of systems. When you test your code in a browser, resize the window to simulate a smaller screen. Last edited by Jellby; 03-29-2011 at 01:43 PM. |
![]() |
![]() |
![]() |
#4 |
The one and only
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,302
Karma: 535819
Join Date: Oct 2008
Location: Berlin, Germany
Device: yup!
|
Yep, sure, it isn't a solutions for small screens. One the iPhone you would have to just use it landscape.
I do keep in mind that ePub isn't meant for two columns anyway. As marginals aren't either. So this is just a solution to save my day. While still being readable on larger screens, though. |
![]() |
![]() |
![]() |
#5 |
GuteBook/Mobi2IMP Creator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
|
The marginals used this way are a perfect example of what should be defined using "definition list" constructs i.e. using <dl>, <dt> and <dd>.
I edited your html to replace each <div> block with a <dt> (definition term) block and <p> block with a <dd> (definition definition) block. I then wrapped the entire "list" in a <dl> block and added the following CSS (note the grey background for the marginals): ![]() Code:
dt { font-size: 1em; float: left; width: 8em; text-align: right; font-style:italic; background-color: #ddd;} dd { margin: 0 0 1em 9em;} ![]() I have used this "definition list" construct before, namely in a conversion of my Webster's Dictionary 1913 in anticipation of having an official dictionary syntax incorporated into EPUB3 using this very same syntax. However, it seems my anticipation was premature... ![]() How well does this appear in your epub reader? |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
KOBO - problem solved | Merbear | Kobo Reader | 2 | 01-14-2011 11:45 AM |
[Solved] Help with name of ereader | James_Wilde | Which one should I buy? | 3 | 10-22-2010 03:37 AM |
Is this defective? (SOLVED) | PoisonWolf | Amazon Kindle | 6 | 10-02-2010 02:03 AM |
SOLVED: How to see the internal memory again | Sunspark | Astak EZReader | 19 | 06-08-2010 11:33 AM |
Now that my mobi problem is solved | Boston | Kindle Developer's Corner | 34 | 11-18-2008 01:08 AM |