469,610 Members | 1,745 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,610 developers. It's quick & easy.

numbered definition list

In firefox, the following standards based css gives me a
numbered definition list:

dl {counter-reset: item1; }

dt:before {
counter-increment: item1; content:
counter(item1) ". ";
}

IE, however, seems to ignore it.

Is there a clean solution, or is the cleanest solution
just to say hey, if user agent does not follow
standards, tough on users.

I like to use a definition list, as this captures the
actual relationships of the text, and is thus robot
friendly, a necessary requirement as search engines give
better imitations of sentience.

--
----------------------
We have the right to defend ourselves and our property, because
of the kind of animals that we are. True law derives from this
right, not from the arbitrary power of the omnipotent state.

http://www.jim.com/ James A. Donald
Jul 24 '07 #1
6 7367
Scripsit James A. Donald:
In firefox, the following standards based css gives me a
numbered definition list:

dl {counter-reset: item1; }

dt:before {
counter-increment: item1; content:
counter(item1) ". ";
}

IE, however, seems to ignore it.
It does. Even IE 7 does not recognize the :before pseudo-element or anything
related to counters in CSS.
Is there a clean solution, or is the cleanest solution
just to say hey, if user agent does not follow
standards, tough on users.
The clean solution is to insert the numbers into the text data, possibly
wrapped inside <spanelements with a class attribute so that they can be
styled if desired. It's clumsy, but it's clean and it works.
I like to use a definition list, as this captures the
actual relationships of the text, and is thus robot
friendly, a necessary requirement as search engines give
better imitations of sentience.
Although it may sound logical to use <dlfor a list of definitions, I'm
afraid the idea has been spoiled by vague specifications (which babble about
using <dlfor miscellaneous use, even dialogs), poor implementations, and
widespread abuse. I don't know of any general-purpose search engine that
pays any attention to <dlmarkup, and I don't expect to see one, since such
an approach would mean that all kinds of stuff is classified as being
"definitions" and "terms". More on this:
http://www.cs.tut.fi/~jkorpela/def.html#markup

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Aug 5 '07 #2
On 24 Jul, 01:11, James A. Donald <jam...@echeque.comwrote:
Is there a clean solution
Embed counters in HTML. CSS support is too poor to rely upon.

There's also the question of whether one _should_ generate counters.
It's OK to do so to link simple footnotes _within_ a page. For
anything more "robust" than this, anything that might have an external
dependency on the actual values, then there's a good argument that
this is now "content" rather than mere presentation and so belongs in
the HTML rather than the CSS by definition, not just pragmatism.

Aug 6 '07 #3
On 2007-08-07, Michael Stemper wrote:
I do know that the W3C validator accepts terms with multiple
definitions as 4.01 Strict.
Also multiple terms for one or more definitions. The W3C page gives
this example:

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

--
Chris F.A. Johnson <http://cfaj.freeshell.org>
================================================== =================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Aug 7 '07 #4
On Fri, 10 Aug 2007, Jukka K. Korpela wrote:
I have repeatedly written about the unsuitability of <dlmarkup in general,
but I feel morally compelled to defend it against claims about ambiguity when
there is no reasonable ambiguity.

The specifications could be _much_ clearer, but the apparent _intended_
semantics is that a <dtelement associates with the first <ddelement after
it. The semantics is undefined when there is no following <ddelement or a
<dlelement begins with a <ddelement.
The three lists <ol>, <ul>, and <dlin HTML are the same as the three
lists \begin{enumerate}, \begin{itemize}, and \begin{description} in
LaTeX. It *could* be that the HTML lists were modelled on LaTeX lists, but
there is IMHO no doubt that these three are indeed frequently needed. In
quite some of my own Web pages I have

<ul><li><p><strong>something:</strongmore about it</p></li... </ul>

because I wanted to spare the effort of writing a CSS spec for the
intended

<dl><dt>something:</dt><dd>more about it</dd... </dl>

given that more or less all browsers would represent that in very ugly way
when there is no style sheet to fix it.

Such kinds of lists occur always when the headline of a paragraph is part
of the paragraph. Definitions of terms are an example but given the
examples in the W3C spec, one should not have qualms to use it for other
things as well.

One will have three or four forms of such list (paragraph-like for
multi-word terms and table-like for variable names, each perhaps in more
than one design) and one may distinguish them by class attributes.

There is one use of <dl>s which I frown upon: tables are, for whatever
reason, considered less accessible than lists, which causes people to
convert two-column tables into <dl>s. This is correct when the table is
only a means of typesetting a list, but it is nonsense when the semantics
is indeed that of a table. There is nothing wrong with using a <tablefor
a table, and there is no need to use something else.

--
Helmut Richter
Aug 10 '07 #5
On Fri, 10 Aug 2007 15:01:23 +0300, "Jukka K. Korpela"
<jk******@cs.tut.fiwrote:
>i.e. a term without a definition, followed by a term and its
definition.

No, that would be an unnatural and contrived interpretation.
Unnatural? Not to someone who generates most of their HTML dynamically.
Perhaps you'd personally never author one like this by hand, but if
you're writing DB queries to generate things, then anything that's not
specifically forbidden becomes almost inevitable, if not actually
compulsory.

There's a suggestion in the W3C rec that <dlmight be used to mark up
dialogue in a play's script. What if it's a Harold Pinter? 8-)

If you're going to bandy around words like "unnatural" , then you need a
solid piece of advice _against_ this structure in the rec., not just
silence over it.
Aug 10 '07 #6
Scripsit Andy Dingley:
On Fri, 10 Aug 2007 15:01:23 +0300, "Jukka K. Korpela"
<jk******@cs.tut.fiwrote:
>>i.e. a term without a definition, followed by a term and its
definition.

No, that would be an unnatural and contrived interpretation.

Unnatural?
Indeed. A <dlis by definition a list of _definitions_. Neither <dtnor
<ddalone makes sense, so an interpretation that leaves a <dtalone, not
associated with any <dd>, is unnatural and contrived, when the markup can
easily be interpreted in a manner that has such an association.
Not to someone who generates most of their HTML
dynamically.
It's completely irrelevant how the markup has been generated. A browser does
not even know whether the HTML has been "dynamically" generated.
Perhaps you'd personally never author one like this by
hand, but if you're writing DB queries to generate things, then
anything that's not specifically forbidden becomes almost inevitable,
if not actually compulsory.
Whatever that means, it's irrelevant.
There's a suggestion in the W3C rec that <dlmight be used to mark up
dialogue in a play's script.
That has nothing to do with the interpretation of a <dlin the case
discussed.
If you're going to bandy around words like "unnatural" , then you
need a solid piece of advice _against_ this structure in the rec.,
not just silence over it.
You seem to misunderstood the question. It's not about using or not using a
particular piece of markup. The question was about _interpreting_ it _if_ it
actually appears. I proved that there is no real ambiguity.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Aug 11 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Jeff Thies | last post: by
5 posts views Thread by Max Bentz | last post: by
9 posts views Thread by Dave H | last post: by
7 posts views Thread by Neil Zanella | last post: by
24 posts views Thread by rudranee | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.