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

  • Home
  • SEARCH
  • 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 7783309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:47:59+00:00 2026-06-01T19:47:59+00:00

I want to do this: This is the HTML/CSS that I have so far,

  • 0

I want to do this:

enter image description here

This is the HTML/CSS that I have so far, but after trying various combinations of float, position absolute/relative, left, left-margin, clear, overflow, etc. I can’t get it to handle varying lengths.

<!DOCTYPE html> 
<html>
<head>
    <style>
        .container {
        }
        .leftColumn {
            float:left;
        }
        .rightColumn {
            float:left;
            left:120px;
            position:absolute;
        }
        .clear {
            clear:both;
        }
    </style>
</head>
<body>
  <div class="container">
        <div class="leftColumn">Apr 14: Title: </div>
        <div class="rightColumn">This is a text that will have a variable width, sometimes short and sometimes very, very long, sometimes short and sometimes very, very long.</div>
        <div class="clear"></div>
  </div>
  <div class="container">
        <div class="leftColumn">Apr 15: Another Title: </div>
        <div class="rightColumn">This is a text that will have a variable width, sometimes short and sometimes very, very long, sometimes short and sometimes very, very long.</div>
        <div class="clear"></div>
  </div>
  <div class="container">
        <div class="leftColumn">Apr 16: A Still Longer Title: </div>
        <div class="rightColumn">This is a text that will have a variable width, sometimes short and sometimes very, very long, sometimes short and sometimes very, very long.</div>
        <div class="clear"></div>
  </div>

</body>
</html>

What do I have to change to the a above CSS so that it handles variable length text in both columns as in the screenshot above?

  • 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-01T19:48:01+00:00Added an answer on June 1, 2026 at 7:48 pm

    see this fiddle : http://jsfiddle.net/UHMtW/

    1) Remove all those awful empty div for clearing of floats (just use easyclearing or some other not-structural equivalent technique)

    2) You’re missing all closing </div> for every .rightColumn

    3) Use this css code [updated]

    .container {
         height: auto; overflow: hidden; width: 100%;
         margin : 0 0 20px 0;
     }
     .leftColumn {
         float:left;
         width : 120px;
     }
     .rightColumn {
         margin-left: 120px;   
     }
    

    of course change the width of the elements as you prefer and give some margin to .container elements

    (As aside note I would suggest to use instead a description list <dl> but this would require to set a maximum height for the left columns. Or maybe you can avoid all that <div>ification using headings and paragraphs properly)

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

Sidebar

Related Questions

I want to achieve this using html and css: I have tried to set
I want apply margin property for my html newsletter But Gmail ignores this CSS
I have this html code that i want to edit with jQuery. Here is
I currently have a tab image that I want to re-create in CSS, but
I'm using this HTML,CSS and Javascript code (in one document together if you want
I have this html file where I want to overlay some text over another.
I have an html page i want to print a portion of this html
http://subzerostudio.com/temp/verticalscroller/temp.html I want this scroll to effect the div#container instead of the body,html but
So I have this simple HTML: <span id=badge>0</span> I want the number 0 to
So I have Html like this http://trac.edgewall.org/wiki/RecentChanges (I want to create some Flash Track

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.