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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:14:37+00:00 2026-05-28T07:14:37+00:00

Firstly, sorry about the question title, it may not be very descriptive for my

  • 0

Firstly, sorry about the question title, it may not be very descriptive for my actually requirements (which is one reason why I can’t find a solution to this with a Google search – I don’t know what to search for)

I am trying to layout some “label text” next to some “value text” but want to keep the value text in line even when it needs to span multiple lines.

Here is an example of the desired result…

Label 1        Value 1
Label 2        Value 2
Label 3        Value 3 is much longer
               so it needs to span multiple lines
               but should be keep in a nice format
Label 4        Value 4

I know I could easily do this with a table but I don’t think a table is appropriate here. Despite what the example data might look like it is not related. Real label examples might be Name, Date, Description, and Reference Number.

I also want to try and avoid using any floating techniques if at all possible – basically because I think using a float would required me to specify a fixed width to ensure a relatively small margin between labels and values.

Other than that I am open to use any elements offered – and of course will use float/tables if they prove to be the best course of action.

Here is a starting JSFiddle of it not working if anybody wants to have a quick play.

Thanks

  • 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-28T07:14:37+00:00Added an answer on May 28, 2026 at 7:14 am

    Try:

    HTML

    <div class="wrapper">
        <span class="Header">Label 1</span>
        <span class="Text">Value 1</span>
    </div>
    
    <div class="wrapper">
        <span class="Header">Label 2</span>
        <span class="Text">Value 2</span>
    </div>
    
    <div class="wrapper">
        <span class="Header">Label 3</span>
        <span class="Text">Value 3 is much longer so it needs to span multiple lines but should be keep in a nice format</span>
    </div>
    
    <div class="wrapper">
        <span class="Header">Label 4</span>
        <span class="Text">Value 4</span>
    </div>
    

    CSS

    .wrapper {
      overflow: hidden;
      width: 200px; /* just for demo */
    }
    
    .Header
    {
        float: left;
        width:100px;
        color: #00F;
        font-weight: bold;
    }
    .Text
    {
        display: block;
        overflow: hidden;
    }
    

    Demo

    http://jsfiddle.net/SGVE5/6/

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

Sidebar

Related Questions

Firstly, I feel sorry about the title, I do not know how to describe
Firstly, sorry for the wording of the question. I'm not too sure how to
Firstly, i am sorry if the title does not properly describe my problem, but
Firstly, sorry about the long question... but this is doing my head in. Any
Firstly, I do not have any malicious intent out of this question. I would
Ladislav, sorry maybe i'm not correctly posed question. Suppose in WinForm application i'm creating
I am sorry if the title is unclear. Allow me to elaborate further. Firstly,
Firstly - sorry for my English.. I've inherited a rather big project which uses
I'am doing homework. Firstly, there was a task to make calculator, which can evaluate
Firstly, please forgive it is already asked one or can be find easily with

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.