![]() |
#1 |
Connoisseur
![]() 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... |
![]() |
![]() |
![]() |
#2 |
Connoisseur
![]() 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; } 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>
Last edited by marst; 04-18-2014 at 06:17 PM. |
![]() |
![]() |
![]() |
#3 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#4 |
Connoisseur
![]() 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 --> } |
![]() |
![]() |
![]() |
#5 |
Color me gone
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#6 |
Connoisseur
![]() 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.
|
![]() |
![]() |
![]() |
#7 | |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
|
|
![]() |
![]() |
![]() |
#8 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,633
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Code:
ul { list-style-type: circle; } |
|
![]() |
![]() |
![]() |
#9 | |
Connoisseur
![]() Posts: 72
Karma: 10
Join Date: Mar 2011
Location: Left coast, USA
Device: Kobo Forma; Android tablet w/Mantano Reader
|
Quote:
|
|
![]() |
![]() |
![]() |
#10 |
Connoisseur
![]() Posts: 72
Karma: 10
Join Date: Mar 2011
Location: Left coast, USA
Device: Kobo Forma; Android tablet w/Mantano Reader
|
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.
|
![]() |
![]() |
![]() |
#11 |
Color me gone
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#12 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
Tags |
bullet, bullet lists, hanging indent |
|
![]() |
||||
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 |