473,695 Members | 2,787 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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>Absolute ly.</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
"descriptio n"? 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 3747
In article <sl************ ****@armaros.dm h.org.uk>,
Dave H <dm*@armaros.dm h.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*******@xs4a ll.netherlands> (nl)
Jul 20 '05 #2
Kris <kr*******@xs4a ll.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.dm h.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
"descriptio n"? 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.dm h.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*****@codesm iths.com> wrote:
On Sat, 31 Jul 2004 09:49:35 -0500, Dave H <dm*@armaros.dm h.org.uk>
wrote:
I have a query regarding definition lists. Is it good practice
semanticall y 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************* *************@p osting.google.c om

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

All the best,
-Claire
Jul 20 '05 #6
Andy Dingley <di*****@codesm iths.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.dm h.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 "descriptio n"? 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 "descriptio n"? 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 "definition s" 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 presentationall y 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.gla.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
4289
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
4242
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: when the definition term (<dt>) on the left is too long, as in the HTML code posted below, the whole definition list gets messed up. I have tested the example with mozilla 1.2.1. Complete code is provided below so you can see what I mean. Anyone...
0
3548
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 usually styled something like: ] Term ] A tab of white space followed by the definition ] By
3
3600
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 non-standard C++ or if the problem lies elsewhere. To summarize static const class members are not being accessed properly when accessed from a DLL by another external object file (not within the DLL). It only occurs when the static const...
41
3944
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 Y contains all the elements that are B but not in A. Z will then have the elements that are in both A and B. One way of doing this is of course to iterate throug the lists and compare each of the element, but is there a more efficient way? ...
18
2489
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
2707
by: Petronius | last post by:
Hallo, does anyone have an idea how to implement difference lists in Javascript? Thanks allot in advance
4
3793
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 definitions are in a two column table, all cells vertically aligned. But I'd like to achieve it with a combination of <DT<DDand CSS so that the result *looks* like this: <TABLE> <TR VALIGN=BASELINE><TD><B>Life<TD>The meaning of life
275
12273
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
9112
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8971
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8824
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8817
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7651
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5831
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2994
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
1970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.