View Single Post
Old 07-04-2009, 06:38 PM   #22
Peake
Member
Peake began at the beginning.
 
Posts: 22
Karma: 32
Join Date: May 2009
Device: none
Hi Alex,

I believe the name attribute was deprecated in XHTML 1.1 for certain tags (a and map), but is still valid under XHTML 1.0. I use the id attribute as sometimes I forget to update names to be unique when cutting and pasting and XHTML validation catches my foopahs.

I do some things differently in my HTML source, which I'll list below, and can be taken with a grain of salt, lol. I do not know if these differences would work in HTML source to generate ePub files or not, as I generally use Mobipocket Creator or mobigen.exe.

h1 for title only
p class="byline" and p class="authors" for those fields
h2 for toc, chapters, etc.
no divs for chapters. I add pagebreaks before the toc/chapters by using h2 {page-break-before: always} in the stylesheet. On longer texts where I don't want pagebreaks before each chapter, I use a div class="section" and specify the css pagebreak for those instead.
id="xxx" attributes in the corresponding h2 tags instead of anchor tags. This works in the html version's toc and the resulting prc file. Also can use these ids in the guide section in mobipocket creator (to specify table of contents, preface, start page and the like). You do need unique anchor tags or id tags for your table of contents if you are creating it yourself. A workaround if you are using Creator to create your TOC is to specify an attribute such as h2 class="toc_ent" or something similar, and creator will add id tags for you.

If you like, I could modify your example and post if that might make my ramblings somewhat clearer.

Regards,
Peake
Peake is offline   Reply With Quote