Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 24th, 2007, 01:15 AM
James A. Donald
Guest
 
Posts: n/a
Default 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
  #2  
Old August 5th, 2007, 09:35 PM
Jukka K. Korpela
Guest
 
Posts: n/a
Default Re: numbered definition list

Scripsit James A. Donald:
Quote:
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.
Quote:
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.
Quote:
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/

  #3  
Old August 6th, 2007, 03:15 PM
Andy Dingley
Guest
 
Posts: n/a
Default Re: numbered definition list

On 24 Jul, 01:11, James A. Donald <jam...@echeque.comwrote:
Quote:
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.

  #4  
Old August 7th, 2007, 07:45 PM
Chris F.A. Johnson
Guest
 
Posts: n/a
Default Re: numbered definition list

On 2007-08-07, Michael Stemper wrote:
Quote:
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)
  #5  
Old August 10th, 2007, 01:55 PM
Helmut Richter
Guest
 
Posts: n/a
Default Re: numbered definition list

On Fri, 10 Aug 2007, Jukka K. Korpela wrote:
Quote:
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
  #6  
Old August 10th, 2007, 10:45 PM
Andy Dingley
Guest
 
Posts: n/a
Default Re: numbered definition list

On Fri, 10 Aug 2007 15:01:23 +0300, "Jukka K. Korpela"
<jkorpela@cs.tut.fiwrote:
Quote:
Quote:
>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.
  #7  
Old August 11th, 2007, 06:15 AM
Jukka K. Korpela
Guest
 
Posts: n/a
Default Re: numbered definition list

Scripsit Andy Dingley:
Quote:
On Fri, 10 Aug 2007 15:01:23 +0300, "Jukka K. Korpela"
<jkorpela@cs.tut.fiwrote:
>
Quote:
Quote:
>>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.
Quote:
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.
Quote:
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.
Quote:
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.
Quote:
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/

 

Bookmarks

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles