473,385 Members | 2,014 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Definition lists as question/answer lists

Hello,

I have a query regarding definition lists. Is it good practice
semantically to use the dt and dd elements to mark up questions and
answers in a frequently asked questions list, or FAQ?

Here is an example of just such a usage:

<dl class="faq">
<di>
<dt>What is Ogg Vorbis?</dt>
<dd><p>Ogg Vorbis is a digital audio compression format,
roughly comparable to AAC, MP3, VQF, etc. A key
difference to these formats is that Ogg Vorbis is
intended to be patent-free.</p>
<p>Strictly speaking Ogg is the container format, and
Vorbis is the actual audio compression scheme.</p>
</dd>
</di>
<di>
<dt>Is Ogg Vorbis streamable?</dt>
<dd><p>Absolutely.</p></dd>
</di>
</dl>

(In the above example I've chosen to group the dt and dd elements with
the di element, introduced in the sixth public Working Draft of XHTML
2.0.)

According to the official Recommendations (HTML 4.0 onwards),
"Definition lists vary only slightly from other types of lists in that
list items consist of two parts: a term and a description. The term is
given by the dt element and is restricted to inline content. The
description is given with a dd element that contains block-level
content."

So can a question be considered a "term", and an answer be considered a
"description"? Definition lists appear to be flexible in their intended
use; for example, the HTML 4.0 Specification (December 1997) states,
"Another application of DL, for example, is for marking up dialogues,
with each DT naming a speaker, and each DD containing his or her
words." So is my FAQ example acceptable, or is it stretching things too
far?

(Looking to how FAQs are marked up in practice on the WWW, I
occasionally see dl being used; far more often, though, heading and
paragraph tags are used instead.)

Many thanks,

Dave
Jul 20 '05 #1
9 3725
In article <sl****************@armaros.dmh.org.uk>,
Dave H <dm*@armaros.dmh.org.uk> wrote:
I have a query regarding definition lists. Is it good practice
semantically to use the dt and dd elements to mark up questions and
answers in a frequently asked questions list, or FAQ?


Why not an unordered list with heading and paragraph markup inside? you
could even wrap the heading into a blockquote, since a FAQ is assumed to
be questions from outsiders.

--
Kris
<kr*******@xs4all.netherlands> (nl)
Jul 20 '05 #2
Kris <kr*******@xs4all.netherlands> wrote:
Why not an unordered list with heading and paragraph markup inside?
There are practical reasons against using list markup in such cases.
After all, we don't use unordered list markup for simple documents that
contain headings and paragraphs, although we _could_ regard it as a
structure consisting of a sequence of items. Lists were clearly meant to
be used what we intuitively regard as an itemized list. And the default
list presentation (with bullets) would probably be something you want to
get rid of.

So just headings and paragraphs is fine. Naturally with other ingredients
like tables and lists if suitable for presenting an answer.
you could even wrap the heading into a blockquote, since a FAQ is
assumed to be questions from outsiders.


A FAQ is assumed to be a list of frequently asked questions with answers
(though quite often companies present "FAQ lists" that contain answers to
questions that they'd like to see asked), but this does not mean that the
questions need to be quoted verbatim. After all, if the question is
frequently asked, it has been asked in many different formulations and
wordings, and the composer of a FAQ should normally formulate the
questions in a concise, understandable way - and abstractly in the sense
of not including specific details pertaining to an individual question.

This means that almost always, the formulations of the questions have
been composed, or at least edited, instead of quoting directly someone's
question. And <blockquote> means a direct quotation, not a rephrase.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #3
On Sat, 31 Jul 2004 09:49:35 -0500, Dave H <dm*@armaros.dmh.org.uk> wrote:
Hello,

I have a query regarding definition lists. Is it good practice
semantically to use the dt and dd elements to mark up questions and
answers in a frequently asked questions list, or FAQ?

[... snip example]

According to the official Recommendations (HTML 4.0 onwards),
"Definition lists vary only slightly from other types of lists in that
list items consist of two parts: a term and a description. The term is
given by the dt element and is restricted to inline content. The
description is given with a dd element that contains block-level
content."

So can a question be considered a "term", and an answer be considered a
"description"? Definition lists appear to be flexible in their intended
use; for example, the HTML 4.0 Specification (December 1997) states,
"Another application of DL, for example, is for marking up dialogues,
with each DT naming a speaker, and each DD containing his or her
words." So is my FAQ example acceptable, or is it stretching things too
far?


I would find it acceptable. It would be similar to the structures which
they show in the spec, in that multiple questions could have a common
answer, in the way that they show multiple terms having a common
definition, and there could be multiple answers to a common question (if
opinions vary), just as there are multiple definitions to a single term.

I would structure a FAQ in that manner, anyway, unless I had some other
reason not to do so. After all, definition lists were not made just for
dictionaries.

--
Accessible web designs go easily unnoticed;
the others are remembered and avoided forever.
Jul 20 '05 #4
On Sat, 31 Jul 2004 09:49:35 -0500, Dave H <dm*@armaros.dmh.org.uk>
wrote:
I have a query regarding definition lists. Is it good practice
semantically to use the dt and dd elements to mark up questions


No one can agree. Certainly not Jukka and I a couple of weeks ago (I
suggest you Google the thread). Subject is "Problem with descriptive
lists in CSS"

--
Smert' spamionam
Jul 20 '05 #5
On Wed, 04 Aug 2004 22:20:37 +0100, Andy Dingley
<di*****@codesmiths.com> wrote:
On Sat, 31 Jul 2004 09:49:35 -0500, Dave H <dm*@armaros.dmh.org.uk>
wrote:
I have a query regarding definition lists. Is it good practice
semantically to use the dt and dd elements to mark up questions


No one can agree. Certainly not Jukka and I a couple of weeks ago (I
suggest you Google the thread). Subject is "Problem with descriptive
lists in CSS"


It's much more useful to give the message-id, since that'll point at
the unique thread you're talking about for a long time to come, while
that subject will probably end up pointing at additional threads in
the future:

16**************************@posting.google.com

Google lets you search by Message-ID on the "Advanced Search" page.

All the best,
-Claire
Jul 20 '05 #6
Andy Dingley <di*****@codesmiths.com> wrote:

No one can agree. Certainly not Jukka and I a couple of weeks ago (I
suggest you Google the thread). Subject is "Problem with descriptive
lists in CSS"


So it seems to come down to matter of opinion, then! Thank you to
everyone who commented in this thread.

Incidently, anyone concerned that the definitions of some of the HTML
elements are too vague might be interested in reading the present XHTML
2.0 draft <http://www.w3.org/TR/xhtml2/> and commenting on the
www-html-editor electronic mailing list.

Regards,

Dave
Jul 20 '05 #7
> On Sat, 31 Jul 2004 09:49:35 -0500, Dave H <dm*@armaros.dmh.org.uk>
wrote:
According to the official Recommendations (HTML 4.0 onwards),
"Definition lists vary only slightly from other types of lists in
that list items consist of two parts: a term and a description. The
term is given by the dt element and is restricted to inline content.
The description is given with a dd element that contains block-level
content."

So can a question be considered a "term", and an answer be considered
a "description"? Definition lists appear to be flexible in their
intended use; for example, the HTML 4.0 Specification (December 1997)
states,
Since they show an example in which a DL is not being used for definitions,
it seems that they intend definition list markup to more structural than
semantic. That is, the markup indicates, "This information is organizable
in the following manner," rather than saying "This is a definition list" --
it provides structure for the information, it doesn't describe what the
information _is_. Obviously, the W3C has done a poor job of naming its
elements.

The use for a definition list is not merely one in which each DD and DT is
necessarily matched up one-to-one (although that often ends up being the
case), but rather, one where each DT _can_ have multiple DDs, where
multiple DTs can have one DD, and multiple DTs can share the same set of
multiple DDs. The spec shows an example of the latter case, which I have
modified to include closing </DT> and </DD> tags:

<DL>
<DT>Center</DT>
<DT>Centre</DT>
<DD> A point equidistant from all points
on the surface of a sphere.</DD>
<DD> In some field sports, the player who
holds the middle position on the field, court,
or forward line.</DD>
</DL>

The most obvious use for such a structure happens to be definitions.

What is interesting is how they define a definition list:
"Definition lists vary only slightly from other types of lists in
that list items consist of two parts: a term and a description."
They choose an interesting choice of words: "a term and a description."
That's not "a word and a definition" or "a term and a definition." So what
exactly _is_ a "term" and a "description"? The semantic meanings are not
explicitly defined. Nor are they vaguely defined, and only the following
information is given:
"The term is given by the DT element and is restricted to inline
content. The description is given with a DD element that contains
block-level content."

The only reference to "definitions" in defining the purpose of a definition
list is in the name "definition list" itself! And we know that an
element's name is not necessarily a precise indication of its purpose --
just look at ADDRESS.

(Except look what the DTD has to say:
"<!-- definition lists - DT for term, DD for its definition -->"

There they say in the comment that DD is for the term's definition.
"<!ELEMENT DL - - (DT|DD)+ -- definition list -->
<!ELEMENT DT - O (%inline;)* -- definition term -->
<!ELEMENT DD - O (%flow;)* -- definition description -->"

Here they say in the comment that DD is for the "definition description."
I take that to mean "definition list term" and "definition list
description" -- they are just telling what DT and DD are initials for. It
seems to me that is what was meant. Not that the comments in the DTD are
that important.)

"Another application of DL, for example, is for marking up
dialogues, with each DT naming a speaker, and each DD containing his
or her words."
Considering the alternate example given, of dialogue, I conclude that
definition list markup is not strictly for definition lists.

HOWEVER:

The fact (or my opinion) that definition list markup is not designated
strictly for definition lists does not mean that a definition list is the
best way to go. For instance, their dialogue example is a terrible one. I
would markup dialogue as a table, in which the first column has speakers,
the second column has what they say, and the third column (if there is a
third column) having comments on how the second should be said (such as
"(angrily)"). Thus, each row represents a single statement.

It would seem to me that most of the uses of definition lists are for
content that could/should (debatably) be marked up with tables, except that
the author wants it to be displayed stylistically in the manner in which
definition lists are usually displayed.

I woudl group the uses of definition lists into two types: The kind that
can be expressed with tables, and the kind where one-to-many or many-to-
many relationships occur of definitions and terms. However, with rowspan
attributes, even the one-to-many relationships of DTs and DDs can be
expressed as tables. So the two types would be data that is tabular and
data that can have many-to-many relationships.

So does that mean that definition lists' only exclusive structural use
(that cannot be represented by tables) is for the availability of many-to-
many relationships bewteen DDs and DTs (as shown in the center/centre
example) (alongside with many-to-one and one-to-one relationships as well)?
If you can find such a use of definition lists on the web that isn't a
dictionary, I'll give you a cookie. In fact, if you find even an online
dictionary that uses a many-to-many relationship with definition lists, you
get a cookie then. One imagined use, though, would be having multiple FAQ
deserving of exactly the same answer -- except that differing opinions
exist, so multiple answers are given.

Since such uses of definition lists are quite rare, it seems to me that
definition lists were _really_ added to the spec for one of two reasons:

1. A presentationally different method of displaying tabular data.
2A. Exclusive use as a means of providing _definitions_ for words, like a
dictionary.
2B. Use as a means of providing _descriptions_ for words/things.

There are many sorts of data that could be expressed tabularly, but are not
represented in that format. I am going to the extreme, but even a list of
heading-section pairs can be represented in a table, when the headings are
of the same level of importance. Likewise, FAQuestions and answers are
tabular in nature (even _moreso_ than heading-section pairs, because
heading-section pairs are merely a small piece of a _tree-like_ structure.)

That does not mean they would be represented as such. After all, HTML does
not have any explicit mechanisms for indicating tree-like heading
structure, although DIV could be used informally for that purpose: it just
has disconnected headings and paragraphs/lists/etc (or, headings and non-
headings).

As far as dictionaries go: Most dictionaries do not put two words together
to be defined at once, though -- they have them in alphabetical order, with
the "definition" for one word being the other, with maybe a note about its
use being "cheifly British" etc. Thus, there is no reason that even
_dictionaries_ could not be represented tabularly.

The thing is, reading definitions tabularly is awkward. It is easier to
read them in definition list format. Therefore, I consider definition
lists to be another way to express tabular data. And since definition
lists consist of terms and _descriptions_, I do not think that they are to
be strictly used as dictionaries. However, I do think that the DD should
describe the term, or describe something about the term.

So definition lists' presence in HTML is for presentational purposes. If
they weren't presentational, DD and DT would be grouped together with TH
and TD - as table cell elements.

So, I finally conclude that a definition list is a linearization of a two-
column table. Somewhat like sectioned and subsectioned documents
themselves are linearizations of the documents' (sub)sections' tree-like
structure.
So is my FAQ example acceptable, or is it stretching
things too far?

Do you consider your FAQ example to be tabular data? Is it tabular data in
the form of "a term and a _description_."

Another way to linearize FAQ-like tabular data is to use headings and
paragraphs, which is what I would use.

Here is the W3C's Definition List section in the spec:
<http://www.w3.org/TR/html401/struct/lists.html#edef-DL>

Sam Hughes (me) wrote:
I would find it acceptable. It would be similar to the structures which
they show in the spec, in that multiple questions could have a common
answer, in the way that they show multiple terms having a common
definition, and there could be multiple answers to a common question (if
opinions vary), just as there are multiple definitions to a single term.

I would structure a FAQ in that manner, anyway, unless I had some other
reason not to do so. After all, definition lists were not made just for
dictionaries.


So I'm changing this answer. A question and answer section _could_ be
tabular, but so could equal-level headings and their accompanying text. I
would consider a FAQ question to be more like a heading than a definition
_term_. Additionally, the answer certainly does not describe the question
itself or anything about the question -- it gives the answer.

If you made a list of FAQs where the accompanying text described what the
question was REALLY asking, then a definition list would be appropriate.

--
Accessible web designs go easily unnoticed;
the others are remembered and avoided forever.
Jul 20 '05 #8
On Thu, 5 Aug 2004, Sam Hughes wrote:
Since they show an example in which a DL is not being used for definitions,
it seems that they intend definition list markup to more structural than
semantic.
The HTML spec indeed reveals itself to have been written by committee
;-} and this is one of the places where it shows.

Jukka is well known for taking a strict line on this one. I have to
admit to being quite a bit broader myself.
The use for a definition list is not merely one in which each DD and DT is
necessarily matched up one-to-one (although that often ends up being the
case),
It should be noted that a dt element can validly (I mean, "valid" in
terms of HTML syntax) have several dd elements; what this means
semantically is not very clearly expressed.
but rather, one where each DT _can_ have multiple DDs, where
multiple DTs can have one DD, and multiple DTs can share the same set of
multiple DDs. The spec shows an example of the latter case, which I have
modified to include closing </DT> and </DD> tags:
quite so.
(Except look what the DTD has to say:
"<!-- definition lists - DT for term, DD for its definition -->"
But the comments in the DTD are -not- normative. I can show you other
places where there are inappropriate comments in the DTD.

So they might help us to understand what the drafters had in mind at
the time, but they don't constitute an authoritative definition of
HTML semantics.
The fact (or my opinion) that definition list markup is not designated
strictly for definition lists does not mean that a definition list is the
best way to go. For instance, their dialogue example is a terrible one. I
would markup dialogue as a table, in which the first column has speakers,
the second column has what they say, and the third column (if there is a
third column) having comments on how the second should be said (such as
"(angrily)"). Thus, each row represents a single statement.


good point.

[snipped a lot that I didn't want to comment on...]

cheers
Jul 20 '05 #9
"Alan J. Flavell" <fl*****@ph.gla.ac.uk> wrote in
news:Pi******************************@ppepc56.ph.g la.ac.uk:
Sam Hughes wrote:
(Except look what the DTD has to say:
"<!-- definition lists - DT for term, DD for its definition -->"
But the comments in the DTD are -not- normative. I can show you other
places where there are inappropriate comments in the DTD.

So they might help us to understand what the drafters had in mind at
the time, but they don't constitute an authoritative definition of
HTML semantics.


Well, Sam Hughes wrote: Not that the comments in the DTD are that important.


but thanks for clarifying that.
--
Accessible web designs go easily unnoticed;
the others are remembered and avoided forever.
Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Mike | last post by:
How do I extract a list of lists from a user defined function and print the results as strings for each list?
7
by: Neil Zanella | last post by:
Hello, I have posted the following message before but got no replies... I am trying to format an HTML definition list with CSS so that it appears as follows, but am having the following problem:...
0
by: Jimmy Cerra | last post by:
I recently came up with a cool little stylesheet for definition lists. There is a small demostration for the impatient . I hope this helps someone. Here's how I did it. Definition lists are...
3
by: DanielBradley | last post by:
Hello all, I have recently been porting code from Linux to cygwin and came across a problem with static const class members (discussed below). I am seeking to determine whether I am programming...
41
by: Odd-R. | last post by:
I have to lists, A and B, that may, or may not be equal. If they are not identical, I want the output to be three new lists, X,Y and Z where X has all the elements that are in A, but not in B, and...
18
by: shaanxxx | last post by:
I have following code . #include<stdio.h> int i; int i; int i; int main() { printf("%d",i); return 0;
12
by: Petronius | last post by:
Hallo, does anyone have an idea how to implement difference lists in Javascript? Thanks allot in advance
4
by: Steve Swift | last post by:
I'm trying to achieve a format of definition lists that matches the definition lists generated by IBM's "BookMaster" (from quite a few years ago). The effect is as if the terms and their...
275
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.