![]() |
#1 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 429
Karma: 65460
Join Date: Jun 2011
Device: Kindle
|
List-like formatting question...
I know which of these is easier, but I'm wondering which is the most likely to produce consistent results across e-readers, and what the "failure" scenarios would look like. What I'm trying to accomplish is a kind of list-like styling that retains its justification without changing the distance between the "bullet" and the "text". (Consequently, a straight-forward hanging indent won't do the trick).
CSS: Code:
.litem { text-align: justify; margin: 0 0 0 4em; } span.lbullet { font-weight: bold; float:left; margin: 0 1em 0 -4em; } Code:
<p class="litem"><span class="lbullet">A (1 [c])</span> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. or... CSS: Code:
td.tdlefths { font-weight: bold; margin: 0; padding: 0; text-align: left; vertical-align: top; white-space: nowrap; } td.tdrighths { padding: 0 0 0 1em; margin: 0; text-align: left; vertical-align: top; } .left { margin: 0; text-align: left; } .just { margin: 0; text-align: justify; } CODE: Code:
<table> <tbody> <tr> <td class="tdlefths"> <p class="left">A (1 [c])</p> </td> <td class="tdrighths"> <p class="just">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> </td> </tr> </tbody> </table> In the first scenario, I see the potential for issues if there are multiple list items with variable length "bullets", resulting in disalignment across the "text" elements (i.e. distance between the bullet and the text will be preserved, but the text will vary relative the left-most marging depending on the length of the "bullet"). The second scenario is just very busy and, like i said, the use of the <table> element makes me a little skeptical. To be clear, if there are other suggestions out there, I'm open to those too, but again, it'd be helpful to know what the failure scenarios are (knowing that there is no "one-size-fits-all" solution in the world of ebooks). Last edited by ElMiko; 06-24-2025 at 03:34 PM. |
![]() |
![]() |
![]() |
#2 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 519
Karma: 8500000
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe, Kindle 4 Touch
|
Why is it that CSS standard lists won't result in the correct display?
In other words, if you are looking for some way to create lists that work on platforms that don't support CSS lists, then my answer would be to ignore those platforms. CSS lists have been around since version 1 of CSS and any reader that doesn't support at least the basic CSS list properties probably isn't worth targeting. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,344
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
![]() Exactly! Worst case - if you realllllllly need to support those really bad/old renderer's...have a second css file. |
|
![]() |
![]() |
![]() |
#4 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,706
Karma: 5703586
Join Date: Nov 2009
Device: many
|
FWIW, from an Accessibility framework, using a normal list (ordered or unordered) styled the way you want with CSS, is much better as the tags themselves document exactly what you are trying to achieve. So no additional aria role information is needed.
A long time ago, someone wrote a popular "create an epub" guide and advised people to create their own headings from P tags, their own list (instead of list tags), use tables or blockquotes for indentation, and etc.. That one popular guide did more to damage the creation of epubs for accessibility (and in general) than anything else. I am constantly see people creating headings from paragraphs instead of css styling the h1-h6 tags themselves. Tags have names that reveal both structure and meaning and they should be used. Using the right tags will not hold back the visual display when you can use css to style just about anything any way you want. Using the proper tags is very important for accessibility, archiving, and search of any digital publication. Sermon done. ![]() Last edited by KevinH; Today at 10:29 AM. |
![]() |
![]() |
![]() |
#5 | |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 429
Karma: 65460
Join Date: Jun 2011
Device: Kindle
|
Quote:
EDIT: to be clear, I have seen some CSS-based workarounds for custom bullets.. e.g. Code:
ul { list-style: none; margin-left: 0; padding-left: 0; } li { padding-left: 1em; text-indent: -1em; } li:before { content: "+"; padding-right: 5px; } Last edited by ElMiko; Today at 12:26 PM. |
|
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Formatting calibredb list? | loviedovie | Calibre | 5 | 10-18-2015 02:20 PM |
Help with proper dashed list formatting, desperate at this point | luczak | ePub | 4 | 07-06-2011 04:18 PM |
Content Master List of Books with Known Formatting Issues | whitearrow | Amazon Kindle | 52 | 04-25-2010 06:57 PM |
Great article on ebook formatting and web standards (A List Apart) | Prospect | News | 6 | 03-10-2010 01:14 AM |
line formatting formatting question | daesdaemar | Workshop | 9 | 02-06-2009 11:47 AM |