Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > <dl> <dd> and <dt> tags and their usage

Reply
Thread Tools

<dl> <dd> and <dt> tags and their usage

 
 
Tim W
Guest
Posts: n/a
 
      04-16-2012
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?

What is the intended use of these three tags? Is there a better
explanation and examples somewhere?

Thanks,

Tim w
 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      04-16-2012
2012-04-16 16:34, 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


It is not properly written Welsh: it uses the ASCII apostrophe, instead
of the proper, curly punctuation apostrophe (which can be written as
&rsquo; in HTML if needed, or normally entered as such).

> and with the indents and line breaks


Indentation might reflect the normal way of presenting the lyrics. I
wonder whether the use of italic is normal as well.

> 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.


The markup is odd inded.

> www.w3schools.com is very unclear


That is not the worst part of its bogosity. See http://www.w3fools.com
for an explanation.

> 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:


Nominally they mean "term being defined" and "definition for a term",
but in practice, they are just used for indentation, mostly in lists of
name/value pairs.

> I presume using these tags to format verse is just wrong and liable to
> give unpredictable results?


It is grotesquely wrong if the elements are taken in their defined
meanings, but virtually nobody does that. The results are fairly
predictable,

> What is the intended use of these three tags? Is there a better
> explanation and examples somewhere?


You might check the HTML 4.01 specification, but browser vendors, search
engine vendors, and other relevant parties don't take it seriously in
issues like this, so why bother?

The markup is odd, but it does the job of indenting stuff. It would be
easier to use <blockquote>, for an entire block, but why bother?

--
Yucca, http://www.cs.tut.fi/~jkorpela/
 
Reply With Quote
 
 
 
 
Captain Paralytic
Guest
Posts: n/a
 
      04-16-2012
On Apr 16, 2:34*pm, Tim W <tim.wn...@mtavirgin.net> 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.comis 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?
>
> What is the intended use of these three tags? Is there a better
> explanation and examples somewhere?
>
> Thanks,
>
> Tim w


Well you only mentioned 2 tags not 3, but I assume that you meant to
include <dl>.

I'm not sure what it is about the w3schools explanation that is not
clear. A definition list is a list of terms and their definitions. Far
from being the same, the w3schools page shows that the item (or term)
to be described is defined in the dt tag and the description of that
item is in the dd tag.

We have dl = definition list, dt = definition term, dd = definition
description.

A search using the popular search engine Google for the words
definition list
(I got those words from the w3schools page), gives many otehr pages
that talk about definition lists. One of them has the summary:
"This article explains what definition lists are why they are useful,
and how use them when writing HTML documents.", which sounds like just
what you are asking.

In future you may find it quicker to use Google to search for the
subject of your query and to peruse the summaries of the pages that it
suggests.

Alternatively just keep asking here and I'm sure we will be only to
happy to type the terms into Google for you.
 
Reply With Quote
 
Captain Paralytic
Guest
Posts: n/a
 
      04-16-2012
On Apr 16, 2:34*pm, Tim W <tim.wn...@mtavirgin.net> wrote:
> I presume using these tags to format verse is just wrong and liable to
> give unpredictable results?


Oh, as to this question. The use of the dl and dd tags (I can no <dt>
tags there), is certainly wrong in teh referenced context, but the
results are fairly predictable. Using something for a purpose for
which is is not intended may not be correct, but it does not follow
that the results of such use cannot be predicted.

A hammer is not supposed to be used to open a bottle, but I can fairly
well predict that if you keep hitting the bottle with a big enough
hammer, the bottle will break.
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      04-16-2012
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">
&mdash; 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
 
Reply With Quote
 
Tim W
Guest
Posts: n/a
 
      04-16-2012
On 16/04/2012 14:59, Jukka K. Korpela wrote:
> 2012-04-16 16:34, 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

>
> It is not properly written Welsh: it uses the ASCII apostrophe,
> instead of the proper, curly punctuation apostrophe (which can be
> written as &rsquo; in HTML if needed, or normally entered as such).
>
>> and with the indents and line breaks

>
> Indentation might reflect the normal way of presenting the lyrics. I
> wonder whether the use of italic is normal as well.
>
>> 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.

>
> The markup is odd inded.
>
>> www.w3schools.com is very unclear

>
> That is not the worst part of its bogosity. See http://www.w3fools.com
> for an explanation.
>
>> 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:

>
> Nominally they mean "term being defined" and "definition for a term",
> but in practice, they are just used for indentation, mostly in lists
> of name/value pairs.
>
>> I presume using these tags to format verse is just wrong and liable to
>> give unpredictable results?

>
> It is grotesquely wrong if the elements are taken in their defined
> meanings, but virtually nobody does that. The results are fairly
> predictable,
>
>> What is the intended use of these three tags? Is there a better
>> explanation and examples somewhere?

>
> You might check the HTML 4.01 specification, but browser vendors,
> search engine vendors, and other relevant parties don't take it
> seriously in issues like this, so why bother?
>
> The markup is odd, but it does the job of indenting stuff. It would be
> easier to use <blockquote>, for an entire block, but why bother?
>


Thanks, I suspected as much.

So am I right to think that the default browser behaviour in the absence
of anything in the CSS would be just to indent? I can see that would be
a pretty useful tag. How would I know what a browser is going to do with
a tag?

Tim W

 
Reply With Quote
 
Tim W
Guest
Posts: n/a
 
      04-16-2012
On 16/04/2012 15:14, Captain Paralytic wrote:
> On Apr 16, 2:34 pm, Tim W<tim.wn...@mtavirgin.net> 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.comis 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?
>>
>> What is the intended use of these three tags? Is there a better
>> explanation and examples somewhere?
>>
>> Thanks,
>>
>> Tim w

> Well you only mentioned 2 tags not 3, but I assume that you meant to
> include<dl>.
>
> I'm not sure what it is about the w3schools explanation that is not
> clear. A definition list is a list of terms and their definitions. Far
> from being the same, the w3schools page shows that the item (or term)
> to be described is defined in the dt tag and the description of that
> item is in the dd tag.
>
> We have dl = definition list, dt = definition term, dd = definition
> description.
>
> A search using the popular search engine Google for the words
> definition list
> (I got those words from the w3schools page), gives many otehr pages
> that talk about definition lists. One of them has the summary:
> "This article explains what definition lists are why they are useful,
> and how use them when writing HTML documents.", which sounds like just
> what you are asking.
>
> In future you may find it quicker to use Google to search for the
> subject of your query and to peruse the summaries of the pages that it
> suggests.
>
> Alternatively just keep asking here and I'm sure we will be only to
> happy to type the terms into Google for you.


Fwiw I was looking at http://www.w3schools.com/tags/tag_dd.asp where
under Definition and Usage we have:

The <dd> tag is used to describe an item in a definition list..... and
<dt> (defines the item in the list).

English is my first language and it isn't clear. Not helped by the example:

Coffee
- black hot drink
Milk
- white cold drink

In which it is anybody's guess where the list is, what is being defined,
what is being described, and what the items are.


Thanks for your help. It does help to ask people rather than googling. I
know you wouldn't reply if you didn't want to.

Tim W


 
Reply With Quote
 
Denis McMahon
Guest
Posts: n/a
 
      04-16-2012
On Mon, 16 Apr 2012 07:14:20 -0700, Captain Paralytic wrote:

> On Apr 16, 2:34Ā*pm, Tim W <tim.wn...@mtavirgin.net> wrote:


>> both <dt> and <dd> seem to be the same thing, items in a list


> Well you only mentioned 2 tags not 3, but I assume that you meant to
> include <dl>.


He identified all 3 in the subject, and in the text commented that two of
three appear to act in a similar manner.

Rgds

Denis McMahon
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      04-16-2012
In article <jmhfei$jna$>,
Tim W <> wrote:

> tags ... <dt> and <dd>


....

> So am I right to think that the default browser behaviour in the absence
> of anything in the CSS would be just to indent?


Mostly browsers don't much do anything but style various elements a
bit and mostly they use a default style sheet for this. And mostly
they use simple styles that are not up to the standard of some
sophisticated requirements.

They are certainly not so sophisticated that, for example, there is a
button to hear the term and then the definition and the voice intones
and pauses like a teacher explaining a term. You know how teachers go!
They say a term and pause and look at the class and all the young
faces suddenly pay attention (because they need to write the thing
down or remember it for a test) and then say, slowly and carefully, -
remember, they are teaching about a possibly new term to the class -
the explanation. They know a term is being defined for them. With
browsers, fat chance! It is much more primitive in reality with
browsers. They are just insensitive robots.

> I can see that would be
> a pretty useful tag. How would I know what a browser is going to do with
> a tag?


There is generally quite good consistency among browsers with most
elements, but it depends on how detailed you want the agreements to be.

There was an old idea once that no one seems to care about much. That
HTML had elements and that they had a meaning and were useful for more
than mere style. But I won't bother you with all that stuff.

--
dorayme
 
Reply With Quote
 
Captain Paralytic
Guest
Posts: n/a
 
      04-17-2012
On Apr 16, 4:56*pm, Tim W <tim.wn...@mtavirgin.net> wrote:
> On 16/04/2012 14:59, Jukka K. Korpela wrote:
>
>
>
>
>
>
>
>
>
> > 2012-04-16 16:34, 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

>
> > It is not properly written Welsh: it uses the ASCII apostrophe,
> > instead of the proper, curly punctuation apostrophe (which can be
> > written as &rsquo; in HTML if needed, or normally entered as such).

>
> >> and with the indents and line breaks

>
> > Indentation might reflect the normal way of presenting the lyrics. I
> > wonder whether the use of italic is normal as well.

>
> >> 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 tagsI
> >> had never come across.

>
> > The markup is odd inded.

>
> >>www.w3schools.comis very unclear

>
> > That is not the worst part of its bogosity. Seehttp://www.w3fools.com
> > for an explanation.

>
> >> 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:

>
> > Nominally they mean "term being defined" and "definition for a term",
> > but in practice, they are just used for indentation, mostly in lists
> > of name/value pairs.

>
> >> I presume using these tags to format verse is just wrong and liable to
> >> give unpredictable results?

>
> > It is grotesquely wrong if the elements are taken in their defined
> > meanings, but virtually nobody does that. The results are fairly
> > predictable,

>
> >> What is the intended use of these three tags? Is there a better
> >> explanation and examples somewhere?

>
> > You might check the HTML 4.01 specification, but browser vendors,
> > search engine vendors, and other relevant parties don't take it
> > seriously in issues like this, so why bother?

>
> > The markup is odd, but it does the job of indenting stuff. It would be
> > easier to use <blockquote>, for an entire block, but why bother?

>
> Thanks, I suspected as much.
>
> So am I right to think that the default browser behaviour in the absence
> of anything in the CSS would be just to indent? I can see that would be
> a pretty useful tag. How would I know what a browser is going to do with
> a tag?
>
> Tim W


Actually, the big problem is that people tend to think of HTML tags in
terms of formatting, rather than in terms of labelling types of data.
It helps to understand the history. Many moons ago, before the advent
of Personal Computers and WYSIWYG editors, the way one created a
manual was to write it on a mainframe in a plain text file using a
language called GML (General Markup Language) and later BookMaster (at
least in the IBM world). The marked up file would then be fed into a
Script processor (a compiler for text) which would produce a book
formatted based on how the data was marked up. Tags in GML tended to
look like this:
:h1.Chapter 1: Introduction
.GML supported hierarchical containers, such as
l
:li.Ordered lists (like this one),
:li.Unordered lists, and
:li.Definition lists
:eol.
There were other tags for citations and other types of element. You
can see this concept carried across in M$ Word, where there are lots
of Styles (Heading 1, Quote, List).

The object was never to worry about the look of a style, but simply to
ensure that your markup identified the type of data correctly. The
equivalent of CSS used by the script processor would then format
everything based on its data type. You never knew what a book was
going to look like until you had compiled and printed it. M$ Word
documents written using styles rather than individual text formatting
are far easier to manage.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If Brit police are terrified their jobs are threatened by cutbacks,this isn't the way to illustrate their value RichA Digital Photography 62 01-12-2011 01:10 AM
Prophets are honored by everyone, except the people of their hometownand their own family. Eljee Digital Photography 8 09-21-2006 05:35 AM
Since MSN CHAT went pay per use. Is their any other free ones out their Hugh Computer Support 8 05-19-2004 05:52 PM
What the pros use to power their flashes... and their digital cameras. Dan Sullivan Digital Photography 21 01-04-2004 04:40 PM
Stop Spammers by Hitting Their Servers - Not Their Email. Magic347 Computer Support 27 07-03-2003 04:36 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57