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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:24:42+00:00 2026-05-16T01:24:42+00:00

I have a list like this: <html> <head> <link type=text/css rel=stylesheet href=testli.css> </head> <body>

  • 0

I have a list like this:

<html>

  <head>
      <link type="text/css" rel="stylesheet" href="testli.css">
  </head>

  <body>
      <ul id='grok'>
          <li>
              <img src='na' class='cimg' />
              <div class='cinner'>
                  <p>Title, max two lines.</p> 
                  <p>Some longish text, max two lines, causes problems when too long.</p>
              </div>
              <div style='clear:both'></div>
          </li>

          <li>
              <img src='na' class='cimg' />
              <div class='cinner'>
                  <p>Title</p>
                  <p>Some longish text here which may wrap some and cause problems..</p>
              </div>
              <div style='clear:both'></div>
          </li>

      </ul>

  </body>
</html>


// testli.css
* {
  margin:0;
  padding:0;
}

#grok {
  list-style-type: none; 
  width: 200px;
}

#grok li {
  background-color: lightgreen;
  margin: 5px; 
  padding: 5px;
  text-align: left;
}

.cimg {
  width:70px;
  height:44px; 
  float:left;
}

.cinner {
  float: left;
  margin: 0px;
  padding: 0px;
  margin-left: 10px;
  font:14px;
}

when the text in the p elements is short, the layout behaves as I want – the thumbnail and the text should appear as if they’re in two separate columns. I’m basically looking to recreate the thumbnails youtube has for recommended items – thumbnail on the left, some text in another column to the right of it. Title and text each allowed two lines of text each.

If the text is too long, the cinner div gets placed below the thumbnail. What’s the right way to force it to always be to the right?

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-16T01:24:43+00:00Added an answer on May 16, 2026 at 1:24 am

    You could do it by setting a min-height on the <li> and then absolutely positioning the image to the left of the title and description:

    #grok {
       list-style-type: none; 
       width: 200px;
    }
    
    #grok li {
       position: relative;
       margin: 5px; 
       padding: 5px;
       min-height: 44px;
    
       /* min-height fix for IE6.  Ideally this would be in an IE6 only stylesheet */
       height: auto !important;
       height: 44px;
    
       background-color: lightgreen;
    }
    
    .cimg {
       position: absolute;
       left: 0;
       top: 0;
       width: 70px;
       height: 44px;        
    }
    
    .cinner {       
       padding: 0 0 0 80px; /* Makes room for the image so it doesn't overlap text */
       font: 14px;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have a list like this: <ul id=mylist> <li id=list-item1>text 1</li> <li id=list-item2>text
I have a list of tuples like this: [ ('a', 1), ('a', 2), ('a',
I have a list of values like this 1000, 20400 22200, 24444 The ranges
I have a list of variable names, like this: ['foo', 'bar', 'baz'] (I originally
I have a list of error codes I need to reference, kinda like this:
I have a large table with list of scores like this, one score per
I have a longish list of files opened in vim that looks like this:
Some existing web services I consume have methods that look something like this: List<Employee>
Hej, assuming I have a code that looks like this: List<User> userList = GetUserByName
Another easy one hopefully. Let's say I have a collection like this: List<DateTime> allDates;

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.