
Andrew asked:
I'm putting the finishing touches on a book for PG. There will be an html file made as well as plain text. This book includes a decent amount of quoted letters and other documents in it. Fairly often, there are headers and/or footers to these which are aligned to be close to the right margin.
So I made a simple CSS declaration for these:
.dateheader {text-align: right; margin-right:2em;}
However, as I progressed through, the name "dateheader" began to seem little inaccurate. The content is also sometimes the name of a place or a person, or a brief phrase.
Any suggestions for a more general (but still accurate) name I could use for this CSS selector?
I don't have any specific suggestion. But one approach might be to investigate how you'd tag that in TEI, then build your class library based on that. Another powerful feature of using the 'class' attribute in XHTML is that one can specify multiple classes in the same 'class' attribute value (the 'class' attribute type is NMTOKENS.) I've found this sometimes gives greater flexibility in both structural markup and in applying CSS styling via selectors. This might help you in the particular markup problem you posed, but not sure. If it might, read on... For those not familiar with multiple classes, here's an example (not targeted to Andrew's specific problem.) This example comes right out of the proposed OEBPS 1.2.1 specification document I'm now working on: <p>Following XHTML 1.1, the Core/Common attribute <code class="attr opt dep">style</code> is deprecated in Basic 1.2. It may be removed in a future version of this specification. Thus, for future upgradeability of documents, it is <em class="rec">strongly recommended</em> the <code class="attr opt dep">style</code> attribute not be used in Basic 1.2 documents; instead, use either the <code class="elem opt nml">style</code> element or external style sheets.</p> For the <code class=". . ."> seen above, the following syntax is used: the first 'class' value item in the list says if it is an element or attribute, the second gives whether it is required or optional, and the third describes its status in the spec (normal, deprecated or removed), for a total of 12 combinations. CSS can be independently applied to these classes, such as the color 'red' for attributes, normal font style for optional, and italic for deprecated. Instead of having to deal with 12 different CSS selectors, we only have to deal with three. Something tells me, Andrew, that your problem might be nicely solved using the multiple class approach. Worth thinking about at least. Jon Noring