Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 06-24-2025, 03:27 PM   #1
ElMiko
Evangelist
ElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileRead
 
ElMiko's Avatar
 
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:
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 my experience, and particulularly when converting to other formats, both floats and tables can get real wonky...

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.
ElMiko is offline   Reply With Quote
Old Yesterday, 04:08 PM   #2
nabsltd
Fanatic
nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.
 
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.
nabsltd is offline   Reply With Quote
Advert
Old Today, 07:50 AM   #3
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
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:
Originally Posted by nabsltd View Post
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.


Exactly!


Worst case - if you realllllllly need to support those really bad/old renderer's...have a second css file.
Turtle91 is offline   Reply With Quote
Old Today, 09:33 AM   #4
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is online now   Reply With Quote
Old Today, 12:20 PM   #5
ElMiko
Evangelist
ElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileRead
 
ElMiko's Avatar
 
Posts: 429
Karma: 65460
Join Date: Jun 2011
Device: Kindle
Quote:
Originally Posted by nabsltd View Post
Why is it that CSS standard lists won't result in the correct display?
To my knowledge, there is very limited flexibility on the list markers (ordered or unordered). For example, I don't know how to specify the desired list "number" as shown in the examples using ol/ul/li css...

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;
}
but that doesn't work for a multiple-item ordered list.

Last edited by ElMiko; Today at 12:26 PM.
ElMiko is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 02:44 PM.


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