Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 387329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:39:46+00:00 2026-05-12T15:39:46+00:00

Definitions lists are a great way to mark up information where some key word

  • 0

Definitions lists are a great way to mark up information where some key word is associated with one or more values.

Since there is the semantic association of a dt with one or more dd elements, is there a way to use CSS to select these associated items.

Consider the following html:

<dl>
  <dt>Foo</dt><dd>foo</dd>
  <dt>Bar</dt><dd>bar</dd>
  <dt>Baz</dt><dd>baz</dd>
</dl>

If I want to present this dl as:

-------  -------  -------
| Foo |  | Bar |  | Baz |
| foo |  | bar |  | baz |
-------  -------  -------

I need a way to say dt/dd pair number one float left, get a border, and so forth.

Right now, the only way I know how to do this is to make separate dls for each set of dt/dd elements:

<dl>
  <dt>Foo</dt><dd>foo</dd>
</dl>
<dl>
  <dt>Bar</dt><dd>bar</dd>
</dl>
<dl>
  <dt>Baz</dt><dd>baz</dd>
</dl>

Which is atrocious from a semantic point of view, these items are all members of one list.

So is there a selector or combination of selectors that will allow me to operate on dt/dd element groups?

Update

What I am looking for/proposing is something like a pseudo-element list-item, where dl:list-item would select a dt and all associated dd elements as one item, in much the same way as the first-line pseudo-element allows one to select a group of characters as a unit.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T15:39:46+00:00Added an answer on May 12, 2026 at 3:39 pm

    This is in response to knittl’s answer. There isn’t room or the capability to adequately respond to knittl’s answer in a comment, and this response is not part of the question, as it addresses the answer to the question. So, I’ll go ahead and post it as an Answer.

    knittl says that what I am looking for is not possible. I suspected that was the case, but I could have missed something when reading various standards.

    However, the reason provided is demonstrably incorrect.

    knittl asserts:

    no, there isn’t because a <dt> can
    have multiple <dd>s and the other way
    round.

    If he had stopped with ‘no, there isn’t’ that would have been the correct answer.

    So, the claim is that it is impossible because we have an indeterminate number of elements in the proposed grouping.

    This claim can be disproved directly by providing an algorithm to produce a set of related elements for any set of dt and dd elements that are children of a dl. Further, it can be disproved by the counter example of an existing pseudo-element that operates over an indeterminate portion of the document.

    The logic to implement a pseudo-element that groups related dt and dd elements is not difficult. So the number of elements of either type is not germane.

    For a given DL element:

    • Specify a collection type to contain dt and dd elements called a dt_dd_group
    • Start a collection of dt_dd_groups called all_groups
    • Inspect each child element (non-recursive):
      • If the element is a dt:
        • If this is the first element or the previous element was not a dt:
          • Create a new dt_dd_group
          • Append the new dt_dd_group to all_groups
          • Append the element to the dt_dd_group
        • Else append the element to the current dt_dd_group
      • Else if the element is a dd:
        • If this is the first element:
          • Create a new dt_dd_group
          • Append the new dt_dd_group to all_groups
          • Append the element to the dt_dd_group
        • Append the element to the current dt_dd_group
    • Return collection all_groups

    This algorithm easily partitions a set of dt/dd elements within a dl into related sets. For any legal dl, including the compliant but pathological case where no initial dt elements are provided:

    <dl><dd>foo</dd><dd>bar</dd><dl>
    

    To say that this mode of selection is impossible due to the indeterminate number or dt or dd elements in such a group is shown to be false. The number of letters in the first line of a paragraph is also indeterminate, yet the :first-line pseudo-element is part of the CSS standards.

    It is reasonable to say that the mode of selection I am looking for is not possible because CSS Working Group did not consider the issue, or that they considered it and chose not to include it in current standards for some reason.

    So, in summation, while a selector that operate on a group of semantically related dt and dd tags is theoretically possible, no such selector has been implemented.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some definition lists which group pictures with definitions of those pictures. What
What's the thoughts on allowing simple constructor/method definitions in header files in C++. Some
Is there some reason why the Prelude doesn't define the list monad like this?
I noticed that VS2010 has some great new ways to build Sharepoint content. List
I'm currently making my way through Learn You a Haskell for Great Good! ,
here are some type definitions in my program FYI: type BitString -> String type
Is there any way, in either VBA or C# code, to get a list
Instead of using long lists of arguments in my function definitions, I prefer to
I know that definitions for :hover must come before the definition for :active in
A few definitions first: Definition 1 A graph G = (V, E) is called

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.