I am creating an ebook for Amazon's Kindle in HTML, and then later use KindleGen to convert it into the Kindle's MOBI version.
The problem I am currently having is with custom bullets for nested unordered lists that I am using for the ebook's Table of Contents. Initially I was using an image in the list-style-image property to create a custom bullet. This was the CSS I was using:
ul.customBullet
{
list-style-image: url('images/bulletPointImage.png');
margin:1.3em;
}
And this was the html:
<ul class ="customBullet">
<li><b><h3>Text 1<b></h3></li> <!-- 1st tier -->
<ul class="customBullet">
<li><h4><b>2:<b></h4> <1-- 2nd tier -->
<ul class="customBullet">
<li><h6>Text 3</h6> <!-- 3rd tier -->
<ul class="customBullet">
<li><h3><a href="#chap1"> Text</a></h3></li> <!-- 4th tier -->
</ul>
</li>
</ul>
</li>
<li ><b>3: <b></li>
<li ><b>4: <b></li>
<li ><b>5: <b></li>
<li ><b>6: <b></li>
<li><b>7: <b></li>
</ul>
</ul>
I was having problems with aligning the bullets with the text. The text appeared one line below the bullet and a little to the left and not alongside as it should (in Firefox). When I previewed the MOBI created with KindleGen in KindlePreviewer, the image of the bullet was coming out tiny (and not proportional to the image file) and the same problem of the bullet not positioned in the same line as the text.
Also, the bullets appear differently in each of the different kindle models (Kindle Paperwhite, Kindle Fire, etc.), the size of the image varied and with different sort of spacing between the bullet and the text.
I then read somewhere online that Kindle does not support the list-style-image tag. Kindle's official supported CSS tags also do not include it. So I created a simple bulleted list without the CSS but with the same html code above. The problem is the same with the spacing. And different shaped bullets appear on each tier. For example a hollow circular one on the first, a squarish one on the second and so on.
So, my question is , is there a way (any lines of code) to make streamlined bullets in html for kindle's ebook without all these variations in different versions, and also without all these unneeded space insertions, and a proper sort of positioning. Bullets that stay the same no matter which version of kindle is being used. Hope I have explained myself properly.
<li>other than the<a>? I would suggest against trying to move the text up a line with negative margins or anything--that will almost certainly not end well: various devices will inevitably treat that stuff just differently enough to make it look a shambles. The old KF7 format, for example, doesn't support negative margins at all. – Tom Mar 10 '14 at 08:23<li><span class="image" /><a>Text</a></li>with a correspondingspan.image { background-image: image.jpg }in the CSS. That said, images in the TOC seem a little strange. What is it that you're trying to do? EDIT: The other thing to do, if images are a must, is to create a file purely for the graphical TOC, and leave the toc.xhtml and toc.ncx as the logical TOCs only. – Tom Mar 18 '14 at 06:39<li>,<a>, and<span>tags) that mean that really graphically intensive works will sometimes still require a graphical TOC file (such as the cookbook I've been working on lately). As far as expanding and collapsing goes: most reading systems will do that automatically if you've nested your TOC as illustrated above. – Tom Mar 18 '14 at 07:05