473,322 Members | 1,379 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,322 software developers and data experts.

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 7558
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jeff Thies | last post by:
I have search results coming back and they need to be numbered. Sounds like an ordered list... It needs to look like this: 1. ********** line one of information * image* line...
5
by: Max Bentz | last post by:
How may I generate a numbered list (using <ol><li>, etc), which contains more than 1000 elements? My list is ok till 999, then it continues with 000, 001, 002, etc. Thanks for a tip Max
9
by: Dave H | last post by:
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? ...
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:...
3
by: RR | last post by:
We have cards that are numbered consecutively. These cards are given out to different people in different sized batches. One group might get 5, the next group might get 20. What is a good...
4
by: Ced | last post by:
Hi, i'm not an expert in C but i try to compile BTNG software under linux kernel 2.4.2-2. I get these errors at the very first stage. Does someone could have a rapid look on this and tell me...
1
by: Andrea Moro | last post by:
As object, I need to implement in a memo or textbox multiline a structured numbered list. I've written some code, that is working, but I'm finding a lot of problems when I need to add elements...
24
by: rudranee | last post by:
hi there, can anyone tell me how to lines from a file which are odd numbered i.e. 1st,3rd,5th...lines. i tried incrementing file pointer by 2 (fp=fp+2) but it does'nt work Can someone give me...
9
by: joba | last post by:
Hi, I am building a program to calculate vacations for employees. Can anyone show me how to write a VBA code to differentiate even-numbered (Eg 2005) years from odd - numbered(Eg.2006) years. ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.