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 div
s, 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:
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:
<div class="Body" id="CHAPTER ID">
<a href="#PREVIOUS CHAPTER ID">
<img src="images/up.png" />
<img src="images/toc.png" />
<a href="#NEXT CHAPTER ID">
<img src="images/down.png" />
<p class="PullQuote">PULL QUOTE</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>
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.