Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 11-21-2011, 08:47 PM   #1
sdm1130
Junior Member
sdm1130 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Nov 2011
Device: iPad
Nested lists with paragraphs

I am creating an eBook for the first time and I am running in to some issues with some nested lists that also contain paragraphs.

Since epubs don't allow for nesting of paragraphs in <li>, I ended up created a few different levels of indentation in CSS and applied those to <p> tags to generate the list layers (sometimes 2 levels and sometimes 3 levels) with no problem - everything looks great in iBooks. After converting the epub to a mobi file (using calibre or kindlegen), the indentation didn't seem to work, so I converted it back to the following:

Code:
<ol>
   <li></li>
   <li>
       <ul>
           <li></li>
       </ul>
   </li>
   <p>
   <li></li>
</ol>
When I view this on the Kindle (for iPad app, if that matters), the indentation works as I want it to, but the <p> has a number in front of it.

I've tried so many different solutions (so many that I'm having a hard time remembering them all) and nothing seems to be working. Can someone point me in the right direction? I have a good understanding of HTML and CSS.

Here is some of the CSS I am using:

Code:
p.indent
{
	margin-left: 35px;
	line-indent: 35px;
	text-indent: -15px;
}

p.indent2
{
	margin-left: 25px;	
	line-indent: 25px;
}

p.indent3
{
	margin-left: 55px;
	line-indent: 55px;
}
Hopefully this post makes some sense. I've been fighting with this for some many hours, my head is getting a bit foggy!
sdm1130 is offline   Reply With Quote
Old 11-21-2011, 09:10 PM   #2
dwig
Wizard
dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.
 
dwig's Avatar
 
Posts: 1,613
Karma: 6718479
Join Date: Dec 2004
Location: Paradise (Key West, FL)
Device: Current:Surface Go & Kindle 3 - Retired: DellV8p, Clie UX50, ...
Quote:
Originally Posted by sdm1130 View Post
...

Code:
<ol>
   <li></li>
   <li>
       <ul>
           <li></li>
       </ul>
   </li>
   <p>
   <li></li>
</ol>
When I view this on the Kindle (for iPad app, if that matters), the indentation works as I want it to, but the <p> has a number in front of it.
because the top level list is an ordered list (<ol>); try using an unordered list (<ul>) like your second level list.

Quote:
I've tried so many different solutions (so many that I'm having a hard time remembering them all) and nothing seems to be working. Can someone point me in the right direction?
You might try using nested <blockquote> tags:

Code:
<P> blah blah</p>
<blockquote>
    <p> blah </p>
        <blockquote>
             <p> blah </p>
        </blockquote>
 </blockquote>
AFAIK, there's no control of the amount of indent in MOBI's implementation of Blockquotes.
dwig is offline   Reply With Quote
Old 11-21-2011, 10:35 PM   #3
sdm1130
Junior Member
sdm1130 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Nov 2011
Device: iPad
Thanks for the quick reply!

Quote:
Originally Posted by dwig View Post
because the top level list is an ordered list (<ol>); try using an unordered list (<ul>) like your second level list.
Unfortunately, that isn't possible. I need to maintain the following...

Code:
1. blah blah
   * blah blah
   * blah blah
       * blah blah
       * blah blah
   * blah blah

   blah blah blah blah blah blah

2. blah blah
   * blah blah
   * blah blah

Quote:
Originally Posted by dwig View Post
You might try using nested <blockquote> tags:

Code:
<P> blah blah</p>
<blockquote>
    <p> blah </p>
        <blockquote>
             <p> blah </p>
        </blockquote>
 </blockquote>
AFAIK, there's no control of the amount of indent in MOBI's implementation of Blockquotes.
I tried nested <blockquote> tags and it gives me the correct indentation, but the lack of control over the indentation doesn't make it a very good solution. On the Kindle, the 3rd layer is very narrow and now very readable.
sdm1130 is offline   Reply With Quote
Old 11-22-2011, 05:37 PM   #4
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by sdm1130 View Post
I tried nested <blockquote> tags and it gives me the correct indentation, but the lack of control over the indentation doesn't make it a very good solution. On the Kindle, the 3rd layer is very narrow and now very readable.
The nested blockquotes is seriously your "best" solution here... unfortunately. Ditch the ol, ul, and li tags and just hardcode your outline using <p> and nested blockquotes. You're banging your head against a wall that's not going to get any softer... I've tried it every which way to Sunday and the scabs on my noggin just now starting to heal.

Check out this post for a way to have more control over indentation on blockquotes IF you're using kindlegen to build the mobi (and ONLY on Kindle devices NOT the Kindle for PC app):

https://www.mobileread.com/forums/sho...10&postcount=5

Last edited by DiapDealer; 11-22-2011 at 05:48 PM.
DiapDealer is offline   Reply With Quote
Old 11-22-2011, 06:32 PM   #5
sdm1130
Junior Member
sdm1130 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Nov 2011
Device: iPad
Thanks DiapDealer. I'll take a look at that link as a possible way to improve what I've settled on for the first release.

For now, I'm getting around the nesting of <ul> in <ol> by putting using <p>1...</p>, <p>2...</p> with the <ul> below that. It's not ideal and there are some less than perfect indentation issues, but it will work for now.

On a slightly different issue... Has anyone ever seen the 1 in the first item of an <ol> displayed in bold after a, in this case, <h3>? I don't see the issue in the Kindle Previewer, so I am not worrying about it too much, but it does display this way in the Kindle for iPad app. Very strange.
sdm1130 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nested Ordered Lists andyd273 Conversion 9 11-17-2011 12:05 PM
Classic Nook Nested Lists ldespain Barnes & Noble NOOK 0 08-08-2011 04:06 PM
Nested headings? crich70 Sigil 20 04-11-2011 10:44 AM
Content Nested collections fartang Amazon Kindle 1 04-09-2011 12:18 PM
Content nested collections alexxx Amazon Kindle 6 06-22-2010 06:05 PM


All times are GMT -4. The time now is 03:58 AM.


MobileRead.com is a privately owned, operated and funded community.