Sent by Jukka K. Korpela on 14 July 2004 08:08
On Wed, 14 Jul 2004, Scott Gould wrote:
> <p>
> <span>Ohhh, nooooose</span>
> <span>Tie myself up tie myself</span>
> <span>Too tiiiight</span>
> ...
> </p>
Although the choice of markup is mostly off-topic in this list, I think
it's on-topic to discuss the CSS implications or complications of the
alternatives. It's useful to remember that a style sheet just specifies
some optional presentational suggestions, and might be ignored for various
reasons - that is, we need to avoid on _counting on_ CSS too much.
The above markup "falls back" to a simple paragraph,
<p>Ohhh, nooooose Tie myself up tie myself Too tiiiight</p>
when no styling is applied to the <span> elements. Therefore,
<p>
<span>Ohhh, nooooose</span><br>
<span>Tie myself up tie myself</span><br>
<span>Too tiiiight</span>
....
</p>
would be safer. And you could then omit the <span> markup, unless you need
it for styling. If you wish to style lines somehow, you may need a
container (an element that contains a line), and <span> is what you could
use here.
Alternatively, you could use
<div class="stanza">
<div>Ohhh, nooooose</div>
<div>Tie myself up tie myself</div>
<div>Too tiiiight</div>
....
</div>
which work reasonable even without any style sheet, _and_ would have
containers for lines. Someone might make the semantic objection that a
stanza is logically a paragraph and should be marked using <p> rather than
the semantics-free <div>. But anyway, regarding to styling, this approach
would imply that there are by default no spacing between the stanzas,
since <div> has no default margins. Stuff like <div> </div>
could be used to create the spacing, but that's clumsy and inflexible.
It's easy to set, say,
div.stanza { margin-top: 1em; }
but we would be left with the problem that when CSS is off, the stanzas
would not be separated.
So there's no simple answer I'm afraid, and the choice between these (or
other) markup alternatives depends, in part, on the type of styling you
wish to apply to the poems. On the other hand, most simple styling like
setting font properties for all the poetry, or tuning the spacing
(margins) between stanzas, or indenting the poetry as a whole, are easily
done in all alternatives I mentioned.
There's yet another problem if the lines can be long: in a narrow window,
a browser might then need to wrap the lines or introduce horizontal
scrolling, neither of which is nice. I have no good solution to that, but
it's probably a rather rare problem.
--
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/