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

Discussion in 'HTML' started by Tim W, Apr 16, 2012.

  1. Tim W

    Tim W Guest

    I was wanting to copy the text of a poem into my blog from Wikipedia here:
    http://en.wikipedia.org/wiki/Calon_Lân#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
     
    Tim W, Apr 16, 2012
    #1
    1. Advertising

  2. 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ân#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/
     
    Jukka K. Korpela, Apr 16, 2012
    #2
    1. Advertising

  3. On Apr 16, 2:34 pm, 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ân#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.
     
    Captain Paralytic, Apr 16, 2012
    #3
  4. On Apr 16, 2:34 pm, Tim W <> 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.
     
    Captain Paralytic, Apr 16, 2012
    #4
  5. 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ân#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
     
    Jonathan N. Little, Apr 16, 2012
    #5
  6. Tim W

    Tim W Guest

    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ân#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
     
    Tim W, Apr 16, 2012
    #6
  7. Tim W

    Tim W Guest

    On 16/04/2012 15:14, Captain Paralytic wrote:
    > On Apr 16, 2:34 pm, 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ân#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
     
    Tim W, Apr 16, 2012
    #7
  8. On Mon, 16 Apr 2012 07:14:20 -0700, Captain Paralytic wrote:

    > On Apr 16, 2:34 pm, Tim W <> 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
     
    Denis McMahon, Apr 16, 2012
    #8
  9. Tim W

    dorayme Guest

    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
     
    dorayme, Apr 16, 2012
    #9
  10. On Apr 16, 4:56 pm, Tim W <> 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ân#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
    :p.GML supported hierarchical containers, such as
    :eek: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.
     
    Captain Paralytic, Apr 17, 2012
    #10
  11. Alan_Smith wrote:

    > Many of the times, these tags are used in place of table tags.


    Not in the real world...

    Have you fixed the errors on your web site yet?

    --
    -bts
    -This space for rent, but the price is high
     
    Beauregard T. Shagnasty, Apr 17, 2012
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. metfan
    Replies:
    2
    Views:
    4,876
    Robert Olofsson
    Oct 21, 2003
  2. hvt
    Replies:
    0
    Views:
    1,231
  3. hvt
    Replies:
    0
    Views:
    1,517
  4. Philipp
    Replies:
    15
    Views:
    712
    Tom Anderson
    May 17, 2008
  5. Krist
    Replies:
    8
    Views:
    6,785
    Arne Vajhøj
    Feb 10, 2010
Loading...

Share This Page