
On Sun, 15 May 2005 21:11:13 -0400, Janet Kegg wrote:
On Sun, 15 May 2005 17:50:44 -0700 (PDT), Andrew Sly wrote:
Ok, new topic of discussion.
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 suggest .alignright
Also useful for signatures. (I actually use .ar -- I like short and easy to type.)
-- Janet
One of the problems with marking the text with a class that describes the presentation (aside from the fact that it's not structural) is that it implies a presentation which may not actually be correct. Note that Andrew does not say that this text is to be right aligned, but "aligned to be close to the right margin." Consider the last example given (modified to be a generic block so as to not imply "paragraphness"): <div class="dateheader"> HERCULES ROBINSON.<br/> S.J.P. KRUGER.<br/> S.J. DU TOIT.<br/> N.J. SMIT.</div> In this particular case, we don't want the text to be right-aligned, we want it to be left-aligned, but shifted significantly out towards the right margin. In the pirate community I have seen these types of blocks identified as being of type "headfoot", presumably because it is primarily used for headers and footers of correspondence. I also know that TEI has an element for this type of thing (although the precise name escapes me at the moment, and I'm far to lazy to go look it up); assuming that the element name is "signature", you could use a class name, for example, of "TEI_signature", indicating that if it were a TEI element it would be the "signature" element. More important than the actual class name used is the notion that it ought to be the same as everyone else uses, so that some uniformity of naming is achieved. Myself, I'd probably opt for "headfoot", not because it's the best or most descriptive, but simply because it seems to have some currency. Now a quick word about the use of the <p> element. Despite what many people seem to think, the <p> element is _not_ a generic block element, it is to be used to indicate paragraphs. Clearly the aforementioned signature block is not a paragraph, and should not be identified as one, particulaly as there already is in common use an element designed _to be_ a generic block element: <div>. Personally, when I encounter a class name like "dateheader" which is obviously intended to move text near the right margin but maintain left alignment, I change the CSS definition to remove the alignment attribute, and instead add the style "margin-left:65%". This moves the block well to the right-side of the viewport, but also scales well when the window is resized. I also like my paragraphs to be indented, so my default CSS includes "p { text-indent:3em }". Now if you combine these two styles, and make the aforementioned signature block a <p> element, you would get something like this (imagine the whole block being moved 2/3 of the way across the page: HERCULES ROBINSON. S.J.P. KRUGER. S.J. DU TOIT. N.J. SMIT. The answer to this problem is simple: if your English professor wouldn't call it a paragraph, use the <div> tag instead.