Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 04-18-2014, 06:07 PM   #1
marst
Connoisseur
marst began at the beginning.
 
marst's Avatar
 
Posts: 72
Karma: 10
Join Date: Mar 2011
Location: Left coast, USA
Device: Kobo Forma; Android tablet w/Mantano Reader
Controlling indents for bulleted lists

(Apologies-in-advance if this should have been posted in a different part of the forums -- this does pertain to creating lists that will end up in EPUB files.) I've been trying to create hanging bulleted text as shown in the attached screen shot -- to control left margin of the list and also the space between bullets and their associated text. It seems impossible with a standard "unordered list" -- you're stuck with the default bullet-to-text space.

Multiple trips to Google and Stack Overflow suggest it can be done with adjacent elements each with CSS definitions that include "float:left". The first would contain the bullet character, and the second the associated text. But so far every experiment with this has produced problems:

1. As soon as the text associated with a bullet is long enough to wrap at the edge of the window, the whole block of text moves below the bullet.

2. Any paragraph below the second of the elements with "float:left" "collapses" into the block of text above it.

3. Changing the size of the bullet (the sole content of the first element with "float:left") shifts the bullet upward or downward, mis-aligning it.

This kind of thing is so simple in Word or in page-composition programs. There must be a way to do it via CSS without these alignment problems. Advice much appreciated...
Attached Thumbnails
Click image for larger version

Name:	hanging-bullets.png
Views:	212
Size:	11.2 KB
ID:	121842  
marst is offline   Reply With Quote
Old 04-18-2014, 06:13 PM   #2
marst
Connoisseur
marst began at the beginning.
 
marst's Avatar
 
Posts: 72
Karma: 10
Join Date: Mar 2011
Location: Left coast, USA
Device: Kobo Forma; Android tablet w/Mantano Reader
Just hacking around I did happen across a combination of tags and CSS instructions that seem to work. But, this is clearly not the purpose of a "DL" and is thus not Semantically Correct.

Code:
dt.bullet {
  float:left;
}

dd.bullet-text {
  margin-left:2.5em;
  margin-bottom:0.4em;
}
In use:

Code:
<dl>
  <dt class="bullet">o</dt> <!-- whatever the bullet char might be -->
  <dd class="bullet-text">The text associated with this bullet goes here.</dd>
</dl>
It's probably a truly horrible idea. Yet, it does seem to do the job and displays as I expected in at least one Android e-reader (Mantano Reader). How it might display elsewhere, I don't know yet.

Last edited by marst; 04-18-2014 at 06:17 PM.
marst is offline   Reply With Quote
Advert
Old 04-18-2014, 06:18 PM   #3
odedta
Addict
odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.
 
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
li{
padding-left:2.5em;
word-wrap:normal;
}

Is this what you're looking for?

Last edited by odedta; 04-18-2014 at 06:23 PM.
odedta is offline   Reply With Quote
Old 04-18-2014, 06:43 PM   #4
marst
Connoisseur
marst began at the beginning.
 
marst's Avatar
 
Posts: 72
Karma: 10
Join Date: Mar 2011
Location: Left coast, USA
Device: Kobo Forma; Android tablet w/Mantano Reader
Thanks — the padding attribute certainly solves the problem of the bullet spacing. How interesting. Either I've simply missed obvious parts of the discussions I've read up to now, or it hasn't come up in them. The bullet size and overall left indent are still uncontrolled (unless there are yet other CSS commands for them that I've missed in sundry discussions).

The test actually looked like this:

Code:
dt.bullet {
  float:left;
  font-family:sans-serif;
  color:gray;
  margin-left:0;
}
dd.bullet-text {
  margin-left:1.75em; <!-- adjust as need be -->
  margin-bottom:0.4em; <!-- likewise -->
}
The "bullet" character — I have been trying a single lower-case "O" ("oh," not zero). It isn't quite what I'm after but looks better to me than the tiny bullet provided by "<ul>". I'd prefer a thinner open disk but haven't found just what I'm after yet, at least as an HTML entity.
marst is offline   Reply With Quote
Old 04-18-2014, 07:07 PM   #5
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
If you have the calibre editor, there are thousands of special characters...BUT the font would have to support them. You might be better off finding your bullet as an image and putting it in there directly.
mrmikel is offline   Reply With Quote
Advert
Old 04-18-2014, 07:30 PM   #6
marst
Connoisseur
marst began at the beginning.
 
marst's Avatar
 
Posts: 72
Karma: 10
Join Date: Mar 2011
Location: Left coast, USA
Device: Kobo Forma; Android tablet w/Mantano Reader
Yes, I suspect it will have to be an image.
marst is offline   Reply With Quote
Old 04-19-2014, 03:00 AM   #7
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by marst View Post
The "bullet" character — I have been trying a single lower-case "O" ("oh," not zero). It isn't quite what I'm after but looks better to me than the tiny bullet provided by "<ul>". I'd prefer a thinner open disk but haven't found just what I'm after yet, at least as an HTML entity.
Like this? http://www.fileformat.info/info/unic...25cb/index.htm
Jellby is offline   Reply With Quote
Old 04-19-2014, 06:49 AM   #8
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,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by marst View Post
The "bullet" character — I have been trying a single lower-case "O" ("oh," not zero). It isn't quite what I'm after but looks better to me than the tiny bullet provided by "<ul>". I'd prefer a thinner open disk but haven't found just what I'm after yet, at least as an HTML entity.
Maybe you could get it with:

Code:
ul {
    list-style-type: circle;
}
But I'm not sure if that is what you are looking for.
RbnJrg is offline   Reply With Quote
Old 04-19-2014, 01:43 PM   #9
marst
Connoisseur
marst began at the beginning.
 
marst's Avatar
 
Posts: 72
Karma: 10
Join Date: Mar 2011
Location: Left coast, USA
Device: Kobo Forma; Android tablet w/Mantano Reader
Quote:
Originally Posted by Jellby View Post
That looks like just the thing, thanks. Then I found my e-reader app (on a tablet) won't display it! Time for a bug report...
marst is offline   Reply With Quote
Old 04-19-2014, 01:46 PM   #10
marst
Connoisseur
marst began at the beginning.
 
marst's Avatar
 
Posts: 72
Karma: 10
Join Date: Mar 2011
Location: Left coast, USA
Device: Kobo Forma; Android tablet w/Mantano Reader
Quote:
Originally Posted by RbnJrg View Post
Maybe you could get it with:
Code:
ul {
    list-style-type: circle;
}
But I'm not sure if that is what you are looking for.
That 'disc' is a bit small. It could work in a pinch, but <ul> itself isn’t quite what I’m after. The <dl> workaround is about right, though it's semantically off-kilter, as it were.
marst is offline   Reply With Quote
Old 04-19-2014, 03:25 PM   #11
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
It isn't a bug if it isn't part of the font character set.
mrmikel is offline   Reply With Quote
Old 04-19-2014, 05:32 PM   #12
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
Try list-style-image:url('sqpurple.gif'); and supply your own image. This may not be supported in ePub.
DaleDe is offline   Reply With Quote
Reply

Tags
bullet, bullet lists, hanging indent


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sigil loses format in bulleted list mlamb Sigil 17 03-20-2014 04:35 AM
Numbered and bulleted list format lost on Nook Simple Touch epub Pondering ePub 2 10-15-2013 09:19 AM
Problem with bulleted list - Mobi conversion Valkrider Conversion 2 07-15-2012 03:53 AM
Indents and hanging indents in epub poetry Derek R ePub 14 02-19-2012 04:43 AM
Dotpoint & Bulleted List problem virtual_ink ePub 3 07-20-2011 06:53 AM


All times are GMT -4. The time now is 01:35 AM.


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