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 8603089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:14:32+00:00 2026-06-12T02:14:32+00:00

I have a <dl> containing short <dt> texts and possibly long <dd> texts. In

  • 0

I have a <dl> containing short <dt> texts and possibly long <dd> texts. In the layout where I’m using them I’d like them to appear side-by-side:

/==============\
|DT  DD........|
|DT  DD........|
|DT  DD........|
\==============/

However, in case the DD’s content is too long I just want it to be truncated (overflow: hidden on the DL). One easy way would be giving the DD a max-width to avoid it to be come too big to fit in one line with the fixed-size DT. However, since the container’s width is already fixed and changes via media queries I’d prefer a solution where I do not have to specify a fixed width dot the DD. Using a percentage for both the DT and DD is also not a solution since that would waste space in the DT in case of a big container.

Fiddle showing the problem: http://jsfiddle.net/ThiefMaster/fXr9Q/4/

Current CSS:

dl { border: 1px solid #000; margin: 2em; width: 200px; overflow: hidden; }
dt { float: left; clear: left; width: 50px; color: #f00; }
dd { float: left; color: #0a0; white-space: nowrap; }
  • 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-06-12T02:14:33+00:00Added an answer on June 12, 2026 at 2:14 am

    Update: I should have read your entire question first.

    Take off the float:left; on the <dd>

    http://jsfiddle.net/fXr9Q/26/

    One possible problem for beginners using this property (as I already alluded to above) is that they assume that setting whitespace: nowrap on an element will prevent that element from dropping to the next line if it is part of a group of floated boxes. The white-space property, however, will only apply to the inline elements inside of the element its applied to, and will not affect block elements or the spacing of the element itself.

    http://www.impressivewebs.com/css-white-space/


    Old

    As you have set widths on the dl and dt, add this to the dd:

    dd{
        overflow: hidden;
        text-overflow: ellipsis;
        width: 150px;
    }
    

    http://jsfiddle.net/fXr9Q/15/

    Be aware – this is CSS3 – will not work on older browsers – it is for you to evaluate if this is a problem or not – most of the time I don’t mind older browsers getting a slightly worse pick of styles.

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

Sidebar

Related Questions

I have a string containing a short-code which looks like the one below: some
I have a table containing a bunch of input fields, sort of like a
I have textarea containing one or more URLs, along with other text content. I
i have a input[type=text] containing the short url for a post. i want to
I have an input text containing a default date and I'm using jQuery's Datepicker
I have a div containing form elements, and I'm using an invisible overlay mask,
I have a layout with a set of divs each containing three fields in
I have a form containing several fields. One of them is a Datetime field.
I have a plain text file looking like this: some text containing line breaks
So I have a table containing fields description and short_description . I imported these

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.