Re: gutvol-d Digest, Vol 10, Issue 28

On Mon, 16 May 2005 11:01:34 -0700 (PDT) Andrew Sly wrote:
On Mon, 16 May 2005, Lee Passey wrote:
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.
First, a brief disclaimer.
I would guess that at least 80% of the people who contribute texts with html markup to PG do not agree with choices made the majority of others who do so.
So, rather than make some futile attemp to define a subset of "PG HTML" it made sense to just recomend simplicity and markup that is valid as per w3c standards.
I've had to accept that despite some markup I disagree with by others, endless conversations, such as can happen here on this list, will do nothing to change it.
Yes, but by the very nature of your original question, you have demonstrated that you are not one of those who have an irrational commitment to a particular syntax. You wanted to know if there was a better class name than "dateheader" for your particular usage. I quite liked Marcello's suggestion to make it TEI-like, which would be (using his example): <div class="TEI_opener"> Great Marlborough Street<br /> <div class="TEI_dateline">November 11, 1848</div> </div> <div class="TEI_salute">My dear Sir,</div> This may be a little more complex than you want to use, so you could just substitute "TEI_opener" for "dateheader" when it appears before the block, and "TEI_closer" when it appears after the block. For a list of correspondences between XHTML and TEI that I have been developing (it is clearly not complete) see http://www.passkeysoft.com/~lee/tei2xhtml.html.
==============
Use of a <div> instead of a <p>:
Your concerns make sense. However, I believe, the last time I checked, that in xhtml 1.0 you are not allowed to have #PCData directly within a div. That is, a div is intended to delimit a section of the document, but its contents must still be in their own block-level elements. A generic <p> still seems to be the obvious choice in this scenario.
This didn't seem right to me so I went out to W3C.org and checked out the XHTML 1.1 DTD. In fact, <div> can contain any %flow element, which includes just about everything -- including #PCDATA. You may have been confused by the changes to the <body> element which now can contain only %block elements. I stick to my original suggestion that <p> should only be used for paragraphs, and <div> should be used for any other generic block-level element for which some other element is not appropriate.
Right-aligning a list of names:
Yes, you are very observant to see that for the list of names quoted below, it is not a totally accurate realization to align its contents to the right. However, I have not found a ideal way to handle a block like this easily, and, with many other projects waiting, I would like to get this done, without spending weeks messing around with markup and styling (which is the amount of time it would take--and still end up with a less-than-idealistic result).
Have you tried not using the "text-align:right" attribute, and using the "margin-left:65%" attribute instead? I think you'll find it's exactly what you're looking for.
For comparison, I have another text which I have been trying to prepare, very carefully, and precisely in regard to markup and styling, which has been stalled for over a year now, and I just feel bogged down whenever I approach it.
I feel your pain :-). I'm nowhere near an expert on styling, so when I encounter a problem like this I try to mark up the text with as much structural precision as possible (using <div> and <span>) and then just hope that someone else will come along and figure out the presentation.
Thanks for listening, Andrew
participants (1)
-
Lee Passey