View Single Post
Old 06-18-2013, 08:17 PM   #6
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,834
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by valyria View Post
What is the best way to incorporate sidebars in Mobi books?
Hi valyria;

As Hitch told previously, if you plan to build your book for mobi7 (old book type of Kindle) then you can't have sidebars because mobi7 doesn't support the property "float" (nor many other properties ). So when you build a book for Kindle, you have to have a code for mobi8 (the modern type of books) and a code for mobi7 (the old type of books). I could find something that is readible for mobi7 and also allows sidebars in mobi8. The code is the following:

Code:
@media amzn-kf8 { /* this code only applies for mobi8 books*/

hr.m7 {
  display: none; /* horizontal lines are hidden under mobi8 */
}

div#sidebar {
 float: left;
 width: 50%;
 font-size: 120%;
 text-indent: 0em;
 text-align: justify;
 margin: 1em 1em 1em 1ex;
 padding: 1em 1em 1em 1ex;;
 border-top: 6px solid black;
 border-bottom: 6px solid black;
}

.fl {
 display: table-cell;
 width: 0.3em;
 font-size: 8em;
 line-height: 80%;
 color: rgb(192, 192, 192);
}

.tf {
 display: table-cell;
 vertical-align: bottom;
 padding-left: 0.5em;
}
}

@media amzn-mobi {  /* this code only applies for mobi7 books*/
hr.m7 {
  margin-top: 0.25em;
  margin-bottom: 0.25em;
 }

div#sidebar {
 text-align: center;
}

.fl {
 display: none; /* this class is hidden under mobi7 */
}

.tf {
 font-size: 1.2em;
 font-weight: bold;
 margin-left: 20%;
}
}
and in the .html page:

Code:
<hr class="m7" />

<div id="sidebar">
    <div class="fl">
      “
    </div>

    <div class="tf">
    ...sometext...
    </div>
</div>

<hr class="m7" />
Below you can see a screenshot about how the book looks in mobi8 and in mobi7.

Regards
Rubén
Attached Thumbnails
Click image for larger version

Name:	screen_shot-18501.gif
Views:	426
Size:	37.0 KB
ID:	107131   Click image for larger version

Name:	sidebar2.jpg
Views:	478
Size:	60.4 KB
ID:	107132  
Attached Files
File Type: epub sidebar.epub (3.0 KB, 309 views)
RbnJrg is offline   Reply With Quote