View Single Post
Old 07-02-2009, 08:50 AM   #17
rogue_ronin
Banned
rogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-books
 
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
}
to your CSS.

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">&nbsp;</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>
Don't Panic!

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 08:54 AM.
rogue_ronin is offline   Reply With Quote