![]() |
#16 | |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,527
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
Code:
em { font-style: italic; } em em { font-style: normal; } Code:
<em>emphasized text with <em>A Title</em> inside.</em> |
|
![]() |
![]() |
![]() |
#17 |
Banned
![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 475
Karma: 796
Join Date: Sep 2008
Location: Honolulu
Device: Nokia 770 (fbreader)
|
You're right, it's not deprecated, I just checked at W3Schools -- but I had a dialogue in another thread that referred to this very thing, and the other guy's point was that with the id attribute, adding an additional tag as an anchor was redundant. It was a good point, I thought.
If you do place your chapters into divs, you get several benefits, besides more control of styling. One is that example above. Another is that the chapter is explicitly instead of implicitly ended. (It's pretty logical, too.) Add a class to the div for chapters, if you don't want to id them -- but if you id them, the link target is already done for you. If you class them, (say, with class="chapter") then just add something like: Code:
div.chapter { page-break-after: always } I think that would work, it's what I intend to do myself, but I'm just beginning... so double-check it, of course. I'm working on a very large xhtml spec -- trying to lay out a general structure that will work for most books. Classes and divs seem to be key to keeping it organized and simple -- well, simpler. It's not ever going to be simple -- there are too many things in a book for that. Here's my current, working chapter layout: Code:
<div class="Body" id="CHAPTER ID"> <h3>CHAPTER HEADING</h3> <ul class="NavLinks" <li> <a href="#PREVIOUS CHAPTER ID"> <img src="images/up.png" /> </a> </li> <li> <a href="#TableOfContents"> <img src="images/toc.png" /> </a> </li> <li> <a href="#NEXT CHAPTER ID"> <img src="images/down.png" /> </a> </li> </ul> <h4>SECTION HEADING</h4> <h5>SUBSECTION HEADING</h5> <p class="Epigram">EPIGRAM</p> <p class="PullQuote">PULL QUOTE</p> <p>CHAPTER CONTENT</p> <p class="SceneBreak"> </p> <img id="MAP ID" class="Map" src="images/MAPNAME.EXT" /> <img id="ILLUSTRATION ID" class="Illustration" src="images/ILLUSTRATIONNAME.EXT" /> <table id="TABLE ID">TABLE CONTENTS</table> <a id="LINK-TO-ENDNOTE ID" class="EndNoteLink" href="END-NOTE-ID">LINK-TO-ENDNOTE NAME</a> </div> ![]() I'm using a Spine/Body layout, so the chapters are part of the body of the book, thus the current class name. It could change. Not everything listed would be in every chapter -- I'm just trying to come up with what might, and trying to think ahead about what to use. I haven't confirmed any of this as valid yet -- just a first swing. I'm doing it this way because I'm writing macro-scripts for everything -- it'll be mostly automated, and I largely won't have to remember it once I figure it out. If you added content to this, it would be pretty ugly. The idea is just to get everything explicitly structured and named -- then CSS it into a thing of beauty. m a r ps: I just looked at your code my browser -- I have an REB1100 and it doesn't have much in the way of CSS support. Last edited by rogue_ronin; 07-02-2009 at 07:54 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#18 | |
Lector minore
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 652
Karma: 1738720
Join Date: Jan 2008
Device: Aura One, Paperwhite Signature
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#19 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 714
Karma: 2003751
Join Date: Oct 2008
Location: Ottawa, ON
Device: Kobo Glo HD
|
![]() Quote:
Code:
p{ text-indent: 0em; } p+p { text-indent: 1.5em; } |
|
![]() |
![]() |
![]() |
#20 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,527
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
I've found that there are many cases to consider, so at the end I decided it was simple to just set:
Code:
p.noindent { text-indent: 0; } |
![]() |
![]() |
Advert | |
|
![]() |
#21 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 75,663
Karma: 134319570
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
1.5em is too larger for paragraph indents. I've taken to using 1.1em in ePub and that just cuts it as far as spacing goes.
|
![]() |
![]() |
![]() |
#22 |
Member
![]() 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 |
![]() |
![]() |
![]() |
#23 |
Sir Penguin of Edinburgh
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,375
Karma: 23555235
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
|
width attribute - A Better Way
This tip is primarily for makers of Mobipocket ebooks. I'm working on replacing nonstandard Mobipocket only attributes with ones that are standards compliant. Here is replacement for width that works with MobiCreator and uses standards compliant attributes:
<style type="text/css"> p.hanging { margin-left:00; text-indent:-20; } </style> |
![]() |
![]() |
![]() |
#24 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
|
|
![]() |
![]() |
![]() |
#25 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
|
Quote:
I'm currently exploring Calibre as a replacement for MobiCreator. Regards, Alex |
|
![]() |
![]() |
![]() |
#26 | |
Sir Penguin of Edinburgh
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,375
Karma: 23555235
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
|
Quote:
|
|
![]() |
![]() |
![]() |
#27 | |
Lector minore
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 652
Karma: 1738720
Join Date: Jan 2008
Device: Aura One, Paperwhite Signature
|
Quote:
That is, I think of the indentation as being: Paragraphs in general are indented by XXX space on the first line, except for the first paragraph in a section, which is not indented. I don't really think of it as being: Paragraphs are not indented, unless they follow another paragraph. |
|
![]() |
![]() |
![]() |
#28 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,527
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Which, besides, is not true. Paragraphs can be indented after an illustration, a centered block, a piece of poetry, etc. (wich are usually not <p>'s, but <div>'s or whatever).
|
![]() |
![]() |
![]() |
#29 |
Sir Penguin of Edinburgh
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,375
Karma: 23555235
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
|
I decided to post again because I have some more examples.
The RAR is a collection of images from His Majesty's Dragon. It'a Ballantine title, and I like what they accomplished in spite of the limitation of the Mobipocket format. The images included are not screenshots. Instead, Ballantine created the title page and section breaks as images. It had to be done this way becuase Mobi format doesn't support embedding fonts and the Kindle doesn't support fonts at all. The Zip is an example of an about page. I don't use most of what is on it, but I keep a copy in my source folder just in case. If you are going to get sophisticated about making ebooks, at some point you really need to include a page like this that discusses the legal status of the text, images, and fonts inlcuded in an ebook. You should mention where you got them, the copyright vs public domain status, and if necessary name the license agreement(s) that allows you to distribute them. Last edited by Nate the great; 09-06-2009 at 12:05 PM. |
![]() |
![]() |
![]() |
#30 | |
Sir Penguin of Edinburgh
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,375
Karma: 23555235
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
|
Quote:
|
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
New ebook user, looking for tips and advice | krunk | Amazon Kindle | 3 | 09-20-2010 05:35 PM |
My fiction...formatting thoughts and tips...? | Simon John Cox | Writers' Corner | 5 | 01-21-2010 11:25 PM |
My share on making an Ebook! For Easy - Medium - and semi-advanced books. | ProDigit | Reading and Management | 16 | 06-08-2009 09:28 AM |
An example of an eBook with terrible formatting | jswinden | Amazon Kindle | 10 | 05-08-2009 06:44 PM |