Tim W wrote:
> I was wanting to copy the text of a poem into my blog from Wikipedia here:
> http://en.wikipedia.org/wiki/Calon_L%C3%A2n#Lyrics
> What with it being Welsh and with the indents and line breaks I just
> opened the html source of the page and copied the tags and all and
> pasted it in. It displays fine no probs but I was troubled by the tags I
> had never come across. www.w3schools.com is very unclear on what these
> tags are for, (both <dt> and <dd> seem to be the same thing, items in a
> list) giving a strange example about coffees, so two questions:
>
> I presume using these tags to format verse is just wrong and liable to
> give unpredictable results?
Many will agree here that
www.w3schools.com is not the best resource,
peppered with errors and has no association with w3.org. I would agree
that the application is wrong in wikipedia, a poem is not a definition
list. I would say is akin to using H# elements simply to make your text
larger. A far better approach is to make a "poem" class and style
appropriately there. Maybe make the "white-space: pre"
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Poem</title>
<style type="text/css">
.poem {
color: #000; background: #ddd;
margin: 1em; padding: 1em; border: 1px solid #000;
display: table-cell;
}
/* make elements in poem preserve white space formatting */
.poem * { white-space: pre; }
.poem p { margin: 0; padding: 0; }
.poem .chorus { font-style: italic; }
.poem .attibute { white-space: normal; text-align: right; }
</style>
</head>
<body>
<div class="poem">
<p>
Nid wy'n gofyn bywyd moethus,
Aur y byd na'i berlau mān:
Gofyn wyf am galon hapus,
Calon onest, calon lān.
</p>
<p>
Calon lān yn llawn daioni,
Tecach yw na'r lili dlos:
Dim ond calon lān all ganu
Canu'r dydd a chanu'r nos.
</p>
<p>
Pe dymunwn olud bydol,
Hedyn buan ganddo sydd;
Golud calon lān, rinweddol,
Yn dwyn bythol elw fydd.
</p>
<p class="chorus">
(Chorus)
</p>
<p>
Hwyr a bore fy nymuniad
Gwyd i'r nef ar adain cān
Ar i Dduw, er mwyn fy Ngheidwad,
Roddi i mi galon lān.
</p>
<p class="chorus">
(Chorus)
</p>
<div class="attibute">
— Welsh
</div>
</div>
</body>
</html>
>
> What is the intended use of these three tags? Is there a better
> explanation and examples somewhere?
Look at the info source and they have examples:
<http://www.w3.org/TR/html401/struct/lists.html#edef-DL>
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com