Problem with descriptive lists in CSS

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joseph Haig

    Problem with descriptive lists in CSS

    I am trying to use descriptive lists, <DL>, as shown in
    <http://www.maths.man.a c.uk/~jhaig/tmp/test.html> with a style sheet
    at <http://www.maths.man.a c.uk/~jhaig/tmp/default-2.css>. With
    Mozilla and Opera they appear correctly, with a border round both the
    <DT> and <DD> parts but in Internet Explorer the borders are messed
    up. Can anyone please tell me where the mistake is?

    As an aside, the <div id="main"> section should have the right border
    20px from the right hand side of the window. How can I get this to
    display properly?

    Thanks.
  • Jukka K. Korpela

    #2
    Re: Problem with descriptive lists in CSS

    jhaig@maths.man .ac.uk (Joseph Haig) wrote:
    [color=blue]
    > I am trying to use descriptive lists, <DL>,[/color]

    The "D" in "DL" stands for "definition ", not description. If you say
    <dl><dt>foo</dt><dd>bar</dd></dl>,
    then you are saying, by HTML specs, that the meaning of the term "foo" is
    defined by the expression "bar". That is, to decide whether something is
    a "foo", one should consult the expression "bar".
    [color=blue]
    > With
    > Mozilla and Opera they appear correctly, with a border round both the
    > <DT> and <DD> parts but in Internet Explorer the borders are messed
    > up. Can anyone please tell me where the mistake is?[/color]

    What you are asking about is a CSS issue, not an HTML matter. From the
    HTML standpoint, the relevant answer is that you should use DL for
    definition lists - though the HTML specifications themselves obscure this
    simple state of affairs. Generally, DL elements are particularly tricky
    in CSS perspective, so it is not fruitful to use DL just to achieve a
    particular layout, violating the semantic considerations, and then try to
    prevent browsers from using that layout.

    For example, using a table would probably be more fruitful if it is just
    a collection of "things" and associated "notes".

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

    Comment

    • Joseph Haig

      #3
      Re: Problem with descriptive lists in CSS

      Thank you for the reply.

      Jukka K. Korpela wrote:
      [color=blue]
      > jhaig@maths.man .ac.uk (Joseph Haig) wrote:
      >[color=green]
      >> I am trying to use descriptive lists, <DL>,[/color]
      >
      > The "D" in "DL" stands for "definition ", not description. If you say
      > <dl><dt>foo</dt><dd>bar</dd></dl>,
      > then you are saying, by HTML specs, that the meaning of the term "foo" is
      > defined by the expression "bar". That is, to decide whether something is
      > a "foo", one should consult the expression "bar".[/color]

      Specifically, I am using this for data taken from a database. <dt> contains
      the field name and <dd> contains the information in that field. Not
      strictly 'definitions' but I still think it is suitable. I will, however,
      take your advise and see if I can do it some other way.
      [color=blue]
      >[color=green]
      >> With
      >> Mozilla and Opera they appear correctly, with a border round both the
      >> <DT> and <DD> parts but in Internet Explorer the borders are messed
      >> up. Can anyone please tell me where the mistake is?[/color]
      >
      > What you are asking about is a CSS issue, not an HTML matter.[/color]

      Could you please suggest a CSS newsgroup? I have not been able to find one
      and this group seemed to be the most suitable for my question.

      Comment

      • Lachlan Hunt

        #4
        Re: Problem with descriptive lists in CSS

        Joseph Haig wrote:[color=blue]
        > Specifically, I am using this for data taken from a database. <dt> contains
        > the field name and <dd> contains the information in that field.[/color]

        That fits the structure of a definition list just fine, no need to
        try and find a different method.
        [color=blue]
        > Could you please suggest a CSS newsgroup?[/color]

        Try comp.infosystem s.www.authoring.stylesheets

        --
        Lachlan Hunt

        lachlan.hunt@la chy.id.au.updat e.virus.scanners

        Remove .update.virus.s canners to email me,
        NO SPAM and NO VIRUSES!!!

        Comment

        • Jukka K. Korpela

          #5
          Re: Problem with descriptive lists in CSS

          Lachlan Hunt <lachlan.hunt@l achy.id.au.upda te.virus.scanne rs> wrote:
          [color=blue]
          > Joseph Haig wrote:[color=green]
          >> Specifically, I am using this for data taken from a database. <dt>
          >> contains the field name and <dd> contains the information in that
          >> field.[/color]
          >
          > That fits the structure of a definition list just fine,[/color]

          Not at all. The _meaning_ of a field name is quite different from the
          different values in the field in different data sets. For example, if the
          name is "year", then the definition might be 'the year in which the book
          was published', if the database is bibliographic. The value of the field
          could be "1952" or "2004" or something else; none of the values _defines_
          what the field name _means_ - rather, any useful interpretation of the
          data requires some external information about that meaning.

          A collection of field name, field value pairs is - both theoretically and
          pragmatically - best described as a table, perhaps so that the field name
          is a <th> element and the field value is a <td> element, though one might
          conceivably use <td> for both of them as well.

          --
          Yucca, http://www.cs.tut.fi/~jkorpela/
          Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

          Comment

          • Lachlan Hunt

            #6
            Re: Problem with descriptive lists in CSS

            Jukka K. Korpela wrote:[color=blue]
            > Lachlan Hunt <lachlan.hunt@l achy.id.au.upda te.virus.scanne rs> wrote:[color=green]
            >>Joseph Haig wrote:[color=darkred]
            >>>Specifically , I am using this for data taken from a database. <dt>
            >>>contains the field name and <dd> contains the information in that
            >>>field.[/color]
            >>
            >> That fits the structure of a definition list just fine,[/color]
            >
            > Not at all. ... For example, if the
            > name is "year", then the definition might be 'the year in which the book
            > was published', if the database is bibliographic.[/color]

            Yes, that's one interpretation of a definition list.
            [color=blue]
            > The value of the field
            > could be "1952" or "2004" or something else; none of the values _defines_
            > what the field name _means_[/color]

            True, but a definition list isn't strictly for defining the meaning
            of a term like in a glossary or dictionary. In that example, the
            definition list can be interpreted as defining the value for the property.

            Lets take a look at the example taken from the HTML 4.01 spec:
            # 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, a sample definition list could be used to markup content like this:
            <dl>
            <dt>Fred</dt>
            <dd><q>Hello Barney</q></dd>
            <dt>Barney</dt>
            <dd><q>Hi Fred</q></dd>
            </dl>

            So, technically, that doesn't fit your strict definition for a
            defintion list either, since "Fred" doesn't mean "Hello Barney", it is
            just the what Fred said; but it does fit what the specification says.

            --
            Lachlan Hunt

            lachlan.hunt@la chy.id.au.updat e.virus.scanners

            Remove .update.virus.s canners to email me,
            NO SPAM and NO VIRUSES!!!

            Comment

            • Harlan Messinger

              #7
              Re: Problem with descriptive lists in CSS


              "Lachlan Hunt" <lachlan.hunt@l achy.id.au.upda te.virus.scanne rs> wrote in
              message news:HfUGc.8294 0$sj4.81862@new s-server.bigpond. net.au...[color=blue]
              > Jukka K. Korpela wrote:[color=green]
              > > Lachlan Hunt <lachlan.hunt@l achy.id.au.upda te.virus.scanne rs> wrote:[color=darkred]
              > >>Joseph Haig wrote:
              > >>>Specifically , I am using this for data taken from a database. <dt>
              > >>>contains the field name and <dd> contains the information in that
              > >>>field.
              > >>
              > >> That fits the structure of a definition list just fine,[/color]
              > >
              > > Not at all. ... For example, if the
              > > name is "year", then the definition might be 'the year in which the book
              > > was published', if the database is bibliographic.[/color]
              >
              > Yes, that's one interpretation of a definition list.
              >[color=green]
              > > The value of the field
              > > could be "1952" or "2004" or something else; none of the values[/color][/color]
              _defines_[color=blue][color=green]
              > > what the field name _means_[/color]
              >
              > True, but a definition list isn't strictly for defining the meaning
              > of a term like in a glossary or dictionary. In that example, the
              > definition list can be interpreted as defining the value for the property.[/color]

              I agree with this.
              [color=blue]
              >
              > Lets take a look at the example taken from the HTML 4.01 spec:
              > # 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.[/color]

              I have some hesitation about this. It would be fine if a list consists of a
              set of distinct characters, each matched with a set of his well-known
              catch-phrases:

              Fonzie
              Aaaaaaayyyyyyyy .
              Arnold from Different Strokes
              Whatchu talkin' 'bout, Willis?
              Flip Wilson's Geraldine
              The devil made me do it!
              What you see is what you get! (Yes, this is where WYSIWYG comes
              from.)
              Whoooooo!!!
              Chester Riley
              What a revoltin' development this is!

              But a script departs from this pattern in a couple of ways. First, it isn't
              an association of *distinct* terms with their corresponding values, in the
              way that a real definition list is. The same character appears on multiple
              entries in the list. Second, it's limited to special cases, because the
              general case of a script or dialog is not a uniform list of characters their
              lines. In the general case, stage directions are interspersed, breaking up
              the monolithic nature of the list. You could have a series DLs separated by
              the stage directions, but that would be semantically dishonest, because the
              set of lines that happens to be between two successive stage directions
              might not be a single cohesive unit. I'm not sure what a *better* markup
              would be in that case, but DL would be rather artificial for this purpose.

              Comment

              • Jukka K. Korpela

                #8
                Re: Problem with descriptive lists in CSS

                Lachlan Hunt <lachlan.hunt@l achy.id.au.upda te.virus.scanne rs> wrote:
                [color=blue]
                > True, but a definition list isn't strictly for defining the
                > meaning of a term like in a glossary or dictionary.[/color]

                Really?
                [color=blue]
                > In that example, the
                > definition list can be interpreted as defining the value for the
                > property.[/color]

                But that's completely different; a <dl> element contains <dt> and <dd>
                elements, and <dt> stands for definition term, and each <dd> supplies a
                definition for some of the term. It's not about defining values of fields
                but about defining meanings of terms.
                [color=blue]
                > Lets take a look at the example taken from the HTML 4.01 spec:
                > # Another application of DL, for example, is for marking up
                > # dialogues,[/color]

                Which is just nonsense. A dialogue is not a definition list in _any_
                sense. We have two options:
                - We think that the W3C has no meaningful definition for what <dl>
                means. Hence we should not use it all. (It does not really serve
                in a useful way as a presentational trick, since CSS can do
                such jobs much better.)
                - We take the normative part, the definition, seriously - more seriously
                than the specification itself - and ignore examples that do not fit
                into that meaning.
                [color=blue]
                > <dt>Fred</dt>[/color]

                Remember that <dt> comes from "definition term". Is "Fred" really a term
                being defined?

                If <dl> is not a list of definitions for terms, then what _is_ it?
                Anything that someone wants to use to achieve a particular layout?
                (Rather poorly, since the default rendering is not very good and the odds
                of styling it are worse than the odds of styling e.g. a table.)
                It's nonsensical to define an element in one particular way and then
                start telling how it "can be used" for completely different meanings as
                well.

                --
                Yucca, http://www.cs.tut.fi/~jkorpela/
                Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

                Comment

                • Andy Dingley

                  #9
                  Re: Problem with descriptive lists in CSS

                  "Jukka K. Korpela" <jkorpela@cs.tu t.fi> wrote in message news:<Xns95202E 25DEA71jkorpela cstutfi@193.229 .0.31>...
                  [color=blue]
                  > - We think that the W3C has no meaningful definition for what <dl>
                  > means. Hence we should not use it all.[/color]

                  This is a rather "dog in the manger" attitude. I could support it more
                  easily if HTML had semantics worth talking about. We all know the
                  "HTML = content, CSS = presentation" argument, but the sad fact is
                  that HTML just doesn't have the inherent detail to support this
                  (without bolting <span class="..." id="..." > everywhere)

                  Who cares what the default semantics of <dl> are ? They're no clearer
                  or less clear than <h2> or <address> (<address> is surely the most
                  confused, yet useful)
                  [color=blue]
                  >(It does not really serve
                  > in a useful way as a presentational trick, since CSS can do
                  > such jobs much better.)[/color]

                  I use <dl> a lot, and I use it whenever I need a list structure where
                  there's a substantial "two part" nature to each list element. I do the
                  rest with CSS, and if I wanted a numbered list I might even do that
                  with CSS. Marking-up dialogue (as the W3C suggest) works well with
                  <dl> and has a reasonable fall-back in the "lost CSS" case. Doing it
                  with <li> would involve rather too many <span>s and changing display
                  properties for my taste.

                  Comment

                  • Brian

                    #10
                    Re: Problem with descriptive lists in CSS

                    Andy Dingley wrote:
                    [color=blue]
                    > Who cares what the default semantics of <dl> are ? They're no clearer
                    > or less clear than <h2> or <address> (<address> is surely the most
                    > confused, yet useful)[/color]

                    I'd say <h2> is pretty clear: a second level heading, a sub-heading.
                    <address> is oddly named, but the semantics seem clear enough. "Who's
                    responsible for this page?"
                    [color=blue]
                    > I use <dl> a lot, and I use it whenever I need a list structure where
                    > there's a substantial "two part" nature to each list element.[/color]

                    As do I. <dl> is most valuable for me as a way to structure groups,
                    where each group does not have the same number of items, e.g.,

                    menu item, price, description, (optional) additional combo price

                    A table could be used, with empty fields, but that's not the best in
                    terms of a data structure.
                    [color=blue]
                    > Marking-up dialogue (as the W3C suggest) works well with
                    > <dl> and has a reasonable fall-back in the "lost CSS" case. Doing it
                    > with <li> would involve rather too many <span>s and changing display
                    > properties for my taste.[/color]

                    I agree, though using <dl> for these purposed -- or for mine -- is
                    dubious. In the end, I've unilatererally changed <dl> from defintion
                    list to general 2+ array list. Frankly, I don't know why the
                    recommendations have general use stuff like <p> and <table> on the one
                    hand, and rediculously specific-use markup like <dl>, <var>, and
                    <samp> on the other.

                    --
                    Brian (remove ".invalid" to email me)

                    Comment

                    • Neal

                      #11
                      Re: Problem with descriptive lists in CSS

                      On Thu, 08 Jul 2004 10:42:18 -0400, Brian
                      <usenet3@juliet remblay.com.inv alid> wrote:
                      [color=blue]
                      > Frankly, I don't know why the recommendations have general use stuff
                      > like <p> and <table> on the one hand, and rediculously specific-use
                      > markup like <dl>, <var>, and <samp> on the other.
                      >[/color]

                      And the pre element. That's entirely presentational!

                      Comment

                      • Jukka K. Korpela

                        #12
                        Re: Problem with descriptive lists in CSS

                        dingbat@codesmi ths.com (Andy Dingley) wrote:
                        [color=blue]
                        > Who cares what the default semantics of <dl> are ?[/color]

                        I do, and its not a matter of "default semantics" but "semantics" .
                        There's such a thing as default rendering, but no such thing as default
                        semantics.

                        But this is mostly a matter of discussing a symptomatic example. The <dl>
                        element per se is not very interesting. What matters is that if we use an
                        element with _no_ idea of its _meaning_, and deceive ourselves thinking
                        that it has a "broad meaning" when it has none, then we'll take this
                        attitude to other matters and obfuscate our markup. Surely if <dl>
                        "means" whatever you think it looks like, <blockquote> "means" indent and
                        <h6> "means" small font, right?

                        If you take markup seriously, you ask yourself: if some browser starts
                        actually supporting <dl> as defined, perhaps visually highlighting <dt>
                        elements strongly, perhaps entering them into a database of terms,
                        perhaps uttering "term" before speaking the content of <dt> and
                        "definition " before speaking <dd>, will you be delighted or feel dirty?
                        [color=blue]
                        > They're no clearer
                        > or less clear than <h2> or <address>[/color]

                        Surely they are. There's no problem around the semantics of <h2>, and the
                        problem with <address> is more with its name than its meaning.

                        --
                        Yucca, http://www.cs.tut.fi/~jkorpela/
                        Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

                        Comment

                        • Andy Dingley

                          #13
                          Re: Problem with descriptive lists in CSS

                          Brian <usenet3@juliet remblay.com.inv alid> wrote in message news:<10eqnaoa8 sknqdf@corp.sup ernews.com>...[color=blue]
                          > Andy Dingley wrote:
                          >[color=green]
                          > > Who cares what the default semantics of <dl> are ? They're no clearer
                          > > or less clear than <h2> or <address> (<address> is surely the most
                          > > confused, yet useful)[/color][/color]

                          To answer both Brian and Jukka
                          [color=blue]
                          > I'd say <h2> is pretty clear: a second level heading, a sub-heading.[/color]

                          So what's a "second level heading" ? Is <h1 ... /><h3 ... /> still
                          valid ?
                          There's some debate over the ordering of these header elements and
                          whether they need to maintain a strict sequence.

                          Personally I think this is bogus. HTML makes no such constraint and
                          although there are _some_ interpretations of them where such a
                          constraint is valid, it's certainly not true for all of them (so keep
                          _your_ constraints out of _my_ contexts)

                          [color=blue]
                          > <address> is oddly named, but the semantics seem clear enough. "Who's
                          > responsible for this page?"[/color]

                          The semantics are only clear if you read the spec ! How many times
                          have you seen <address> used in a context of "Contact details for one
                          entity, which may be a list of several and might not even be 'the
                          page'". Is it valid to use <address> on a Yellow Pages site ? Can it
                          ever be valid to have more than one on a single page ?

                          There's also the question of data type. Is a phone number an address ?
                          Clearly not, but the HTML spec does clarify that this is still an
                          acceptable use. As Jukka suggests, the intended meaning itself is
                          perhaps clearer (if anyone reads it) than the assumption most authors
                          would draw from the name.

                          Personally I think the spec is wrong here. Wording of "contact or
                          location details" would be just as well applicable for the authorship
                          case and it would extend it to addresses of generalised entities.
                          IMHO, this would be a useful feature.

                          [color=blue]
                          > Frankly, I don't know why the
                          > recommendations have general use stuff like <p> and <table> on the one
                          > hand, and rediculously specific-use markup like <dl>, <var>, and
                          > <samp> on the other.[/color]

                          I can guess. I used to share cubespace with Dave Raggett, and whenever
                          you mentioned such things there was a look of horror that spread over
                          his face. I suspect that HTML 3.2 features have about the same
                          resonance for the HTML 4.0 team as the Orcish hordes over-running
                          Helm's Deep.

                          OTOH, I still use <menu>
                          [color=blue][color=green]
                          > > Who cares what the default semantics of <dl> are ?[/color]
                          >
                          > I do, and its not a matter of "default semantics" but "semantics" .
                          > There's such a thing as default rendering, but no such thing as default
                          > semantics.[/color]

                          I mean the semantics that are assumed in the absence of any further
                          qualifying mechanism. These are by necessity bland. They're either in
                          a context (such as vanilla HTML) where there's little scope to specify
                          them more tightly for any instance, or they're in a full-blown SemWeb
                          context where everything that matters is draped with dangling URIs
                          like Inca khipu (and so anything that isn't specified, ought to be
                          regarded as unworthy of being so).
                          [color=blue]
                          > But this is mostly a matter of discussing a symptomatic example.[/color]

                          Agreed. There just isn't enough depth in HTML to really allow this
                          argument to be taken to a worthwhile conclusion. Even with a good and
                          precise understanding of <dl>, we'd still only have one tiny island in
                          a vast empty sea.

                          [color=blue]
                          > Surely if <dl> "means" whatever you think it looks like, <blockquote> "means" > indent and <h6> "means" small font, right?[/color]

                          Topology vs. typography.

                          <dl> means "two part structure to the list elements", which is a
                          topological distinction, no matter how you render it. <blockquote> is
                          merely fonts and margins.

                          [color=blue]
                          > If you take markup seriously, you ask yourself: if some browser starts
                          > actually supporting <dl> as defined, perhaps visually highlighting <dt>
                          > elements strongly, perhaps entering them into a database of terms,
                          > perhaps uttering "term" before speaking the content of <dt> and
                          > "definition " before speaking <dd>, will you be delighted or feel dirty?[/color]

                          That would be a broken browser. <dl> isn't defined to anything like
                          that level of detail, and it's _wrong_ to start assuming it is (which
                          isn't to say that some browser doesn't already).

                          Comment

                          • Lachlan Hunt

                            #14
                            Re: Problem with descriptive lists in CSS

                            Neal wrote:[color=blue]
                            > And the pre element. That's entirely presentational![/color]

                            No, it's not! <pre> stands for preformatted text, unlike the
                            white-space: pre; css value which stands for preserve white space.
                            Preformatted text is used when it's semantically important to preserve
                            the formatting. I realise that may be a very fine line between
                            presentation and semantics, but it's best explained with some examples.
                            eg. Marking up blocks of code, plain text such as emails (like in many
                            mailing list archives), ASCII art, etc.

                            --
                            Lachlan Hunt

                            lachlan.hunt@la chy.id.au.updat e.virus.scanners

                            Remove .update.virus.s canners to email me,
                            NO SPAM and NO VIRUSES!!!

                            Comment

                            • Brian

                              #15
                              Re: Problem with descriptive lists in CSS

                              Andy Dingley wrote:
                              [color=blue]
                              > Brian wrote...
                              >
                              > So what's a "second level heading" ? Is <h1 ... /><h3 ... />
                              > still valid ? There's some debate over the ordering of these header
                              > elements and whether they need to maintain a strict sequence.
                              >
                              > Personally I think this is bogus.[/color]

                              FWIW, I don't. I would no sooner skip <h2> in a document then I would
                              make an outline that skipped a level. Really, skipping a level in an
                              outline makes no sense. So why do it in HTML?
                              [color=blue]
                              > HTML makes no such constraint[/color]

                              It seems to go out of its way to not impose such constraints.
                              [color=blue][color=green]
                              >> <address> is oddly named, but the semantics seem clear enough.
                              >> "Who's responsible for this page?"[/color]
                              >
                              > The semantics are only clear if you read the spec ![/color]

                              Hence, "oddly named," but still semantic.
                              [color=blue]
                              > How many times have you seen <address> used in a context of
                              > "Contact details for one entity, which may be a list of several and
                              > might not even be 'the page'".[/color]

                              Not as often as I've seen blockquote for indent, which is far worse.
                              Regardless, I don't base good practice on the www's worst examples of
                              HTML.
                              [color=blue]
                              > Is a phone number an address ?[/color]

                              Not in the English language sense, no.
                              [color=blue]
                              > the HTML spec does clarify that this is still an acceptable use.[/color]

                              Of course, since <address> is for contact info, and phone number is a
                              means of contact.
                              [color=blue][color=green]
                              >> Frankly, I don't know why the recommendations have general use
                              >> stuff like <p> and <table> on the one hand, and rediculously
                              >> specific-use markup like <dl>, <var>, and <samp> on the other.[/color]
                              >
                              > I can guess. I used to share cubespace with Dave Raggett, and
                              > whenever you mentioned such things there was a look of horror that
                              > spread over his face. I suspect that HTML 3.2 features have about
                              > the same resonance for the HTML 4.0 team as the Orcish hordes
                              > over-running Helm's Deep.[/color]

                              I'm not sure I follow. Did the elements I mentioned only enter the
                              spec at 3.2? Or 4.0?

                              Jukka Korpela wrote:[color=blue][color=green]
                              >> if some browser starts actually supporting <dl> as defined,
                              >> perhaps visually highlighting <dt> elements strongly, perhaps
                              >> entering them into a database of terms, perhaps uttering "term"
                              >> before speaking the content of <dt> and "definition " before
                              >> speaking <dd>[/color]
                              >
                              > That would be a broken browser. <dl> isn't defined to anything like
                              > that level of detail,[/color]

                              What do you mean? It's defined to be a definition list. How can you
                              declare a browser broken if it does something with the definitions
                              contained therein?

                              --
                              Brian (remove ".invalid" to email me)

                              Comment

                              Working...