View Full Version : XHTML: Attributes "start" at <ol> and "value" at <li>


mmat1
02-18-2012, 12:54 PM
These attributes are deprecated within xhtml.

But how can I do it without violation of the yhtml standard ? Is there any css equivalent ??

Toxaris
02-18-2012, 02:58 PM
No, unfortunately not. These attributes are not supported in the ePUB specifications and will not work on most readers.

mmat1
02-18-2012, 05:25 PM
No, unfortunately not. These attributes are not supported in the ePUB specifications and will not work on most readers.

Thanks, I see i didn't ask clearly enough.

What are the (valid) css-replacements for those attributs ??

Toxaris
02-19-2012, 03:59 AM
There aren't any in the current CSS specs, so also not in the ePUB specs.

chrisridd
02-20-2012, 07:42 AM
There aren't any in the current CSS specs, so also not in the ePUB specs.

You're right, but you could simulate it using a style for each list item:

ol { list-style-type: none; }
li.one:before { content: "One: "; }
li.two:before { content: "Two: "; }

<ol>
<li class="one">Hello</li>
<li class="two">Hello</li>
</ol>

etc.

That would be really tedious to maintain in anything apart from a trivial test document.

You could do it using CSS counters as well, but they are not widely supported.

Jellby
02-20-2012, 01:34 PM
You're right, but you could simulate it using a style for each list item:

ol { list-style-type: none; }
li.one:before { content: "One: "; }
li.two:before { content: "Two: "; }

<ol>
<li class="one">Hello</li>
<li class="two">Hello</li>
</ol>

etc.

Except that the ePub spec says of the "content" property:

Must not be used within a style sheet whose @media value is other than aural.

I'm not sure why, though.

chrisridd
02-20-2012, 02:03 PM
Except that the ePub spec says of the "content" property:

Must not be used within a style sheet whose @media value is other than aural.

I'm not sure why, though.

That's a bit bizarre. They add a custom way of doing columns that no HTML/CSS rendering engine supports, and then prevent the use of something that works. Hm.

mmat1
02-20-2012, 02:07 PM
ol { list-style-type: none; }
li.one:before { content: "One: "; }
li.two:before { content: "Two: "; }


Thanks for your answer, but i fear that will not work as supposed. The idea of a numbered list is to have always the text started in the same "tab-stop-position", no matter how long the number is. Unfortuantely, html does not support tabs....

Btw. the book, i'm thinking about has 400 List entries, the first Chapter-Break is after no. 67.

@Jellby: the "ePub spec" ?? sounds that there's something i should read. If possible, can you give me a link? Yes I know, Google ... but it's always bettet to get a tip to a good source of information.

chrisridd
02-20-2012, 02:12 PM
Thanks for your answer, but i fear that will not work as supposed. The idea of a numbered list is to have always the text started in the same "tab-stop-position", no matter how long the number is. Unfortuantely, html does not support tabs....

There are spacing options for list markers, but I'm not sure how robust they are. But forget this approach - if the epub specs forbid it then it is a waste of time.

@Jellby: the "ePub spec" ?? sounds that there's something i should read. If possible, can you give me a link? Yes I know, Google ... but it's always bettet to get a tip to a good source of information.

Start at http://idpf.org/epub and use the "EPUB" menu to find version 3 and 2.0.1 of the specs.

KLUTCH
02-23-2012, 11:03 AM
Kindle and iBooks will display ol/li ul/li without any major issues if you don't add classes.
The only issue you might get into would be with nested list, it's best to take these as they come.