473,721 Members | 3,776 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7588
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
"definition s" 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{enumerat e}, \begin{itemize} , and \begin{descript ion} 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><str ong>something:</strongmore about it</p></li... </ul>

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

<dl><dt>somethi ng:</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.tu t.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.tu t.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 "dynamicall y" 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
638
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 two of information **********
5
2809
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
3751
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? Here is an example of just such a usage: <dl class="faq"> <di>
7
4248
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...
3
2254
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 way to set up to keep track of which numbered cards are given out, and to who?
4
25519
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 what's wrong regards I get this error:
1
996
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 in the middle, operation that require a full remaps of next elements. Unfortunately I must use one string's collection to store my elements. Any idea on how continue this hard work?
24
6144
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 the code please.
9
2981
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. Thank you
0
9227
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...
0
9081
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
8020
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
6676
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
4497
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4761
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3206
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
2
2590
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2143
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.