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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:00:11+00:00 2026-05-13T23:00:11+00:00

I often need to list items with various-sized images on the left and text

  • 0

I often need to list items with various-sized images on the left and text on the right, like this:

alt text http://www.deviantsart.com/upload/7s01l5.png

For 17 years, I have solved this with HTML tables, like this:

<html>

  <style>

    * { margin: 0; padding: 0 }

    body {
      padding: 20px;
    } 

    #content {
      width: 600px;
      padding: 20px;
      margin-left: auto;
      margin-right: auto;
      background: green;  
    }

    .item {
      margin: 0 0 20px 0;
    }

    .itemIcon {
      float:left;
    }

    .itemBody {
      float:right;
    }

    .clear {
      clear: both;
    }

  </style>

<body>

<div id="content">

  <div class="item">
    <div class="itemIcon">
      <img src="icon.png" alt=""/>  
    </div>
    <div class="itemBody">
      <h1>This is the first item</h1>
      <p>Aliquid aliquam fabulas duo an, eu delenit intellegebat has, in sit commodo aliquip. Inermis neglegentur vis an, ea mei habeo animal verterem. Cum vivendo intellegam disputando id, usu id dicta harum convenire. Cibo corpora ut pri, sed legere probatus aliquyam no, vidisse suscipiantur eu mea. Modus etiam concludaturque pro an, ut latine quaeque per. Harum ignota mnesarchum pri ad, duo et diam oblique epicurei, pri ne vivendo omnesque epicurei.</p> 
    </div> 
    <br class="clear"/>
  </div>

  <div class="item">  
    <div class="itemIcon">
      <img src="bigIcon.png" alt=""/>  
    </div>
    <div class="itemBody">
      <h1>This is the second item</h1>
      <p>Aliquid aliquam fabulas duo an, eu delenit intellegebat has, in sit commodo aliquip. Inermis neglegentur vis an, ea mei habeo animal verterem. Cum vivendo intellegam disputando id, usu id dicta harum convenire. Cibo corpora ut pri, sed legere probatus aliquyam no, vidisse suscipiantur eu mea. Modus etiam concludaturque pro an, ut latine quaeque per. Harum ignota mnesarchum pri ad, duo et diam oblique epicurei, pri ne vivendo omnesque epicurei.</p> 
    </div>    
    <br class="clear"/>
  </div> 

  <div class="item">
    <div class="itemIcon">
      <img src="icon.png" alt=""/>  
    </div>
    <div class="itemBody">
      <h1>This is the first item</h1>
      <p>Aliquid aliquam fabulas duo an, eu delenit intellegebat has, in sit commodo aliquip. Inermis neglegentur vis an, ea mei habeo animal verterem. Cum vivendo intellegam disputando id, usu id dicta harum convenire. Cibo corpora ut pri, sed legere probatus aliquyam no, vidisse suscipiantur eu mea. Modus etiam concludaturque pro an, ut latine quaeque per. Harum ignota mnesarchum pri ad, duo et diam oblique epicurei, pri ne vivendo omnesque epicurei.</p> 
    </div> 
    <br class="clear"/>
  </div>

</div>

</body>
</html>

Everytime I have tried to switch to floating divs, it has failed for one reason or another, here is my current attempt:

alt text http://www.deviantsart.com/upload/tuvquv.png

What do I have to change to this code so that this div solution looks like the table solution?

<html>

  <style>

    * { margin: 0; padding: 0 }

    body {
      padding: 20px;
    } 

    #content {
      width: 600px;
      padding: 20px;
      margin-left: auto;
      margin-right: auto;
      background: green;  
    }

    .item {
      margin: 0 0 20px 0;
    }

    .itemIcon {
      float:left;
    }

    .itemBody {
      float:right;
    }

    .clear {
      clear: both;
    }

  </style>

<body>

<div id="content">

  <div class="item">
    <div class="itemIcon">
      <img src="icon.png" alt=""/>  
    </div>
    <div class="itemBody">
      <h1>This is the first item</h1>
      <p>Aliquid aliquam fabulas duo an, eu delenit intellegebat has, in sit commodo aliquip. Inermis neglegentur vis an, ea mei habeo animal verterem. Cum vivendo intellegam disputando id, usu id dicta harum convenire. Cibo corpora ut pri, sed legere probatus aliquyam no, vidisse suscipiantur eu mea. Modus etiam concludaturque pro an, ut latine quaeque per. Harum ignota mnesarchum pri ad, duo et diam oblique epicurei, pri ne vivendo omnesque epicurei.</p> 
    </div> 
    <br class="clear"/>
  </div>

  <div class="item">  
    <div class="itemIcon">
      <img src="bigIcon.png" alt=""/>  
    </div>
    <div class="itemBody">
      <h1>This is the second item</h1>
      <p>Aliquid aliquam fabulas duo an, eu delenit intellegebat has, in sit commodo aliquip. Inermis neglegentur vis an, ea mei habeo animal verterem. Cum vivendo intellegam disputando id, usu id dicta harum convenire. Cibo corpora ut pri, sed legere probatus aliquyam no, vidisse suscipiantur eu mea. Modus etiam concludaturque pro an, ut latine quaeque per. Harum ignota mnesarchum pri ad, duo et diam oblique epicurei, pri ne vivendo omnesque epicurei.</p> 
    </div>    
    <br class="clear"/>
  </div> 

  <div class="item">
    <div class="itemIcon">
      <img src="icon.png" alt=""/>  
    </div>
    <div class="itemBody">
      <h1>This is the first item</h1>
      <p>Aliquid aliquam fabulas duo an, eu delenit intellegebat has, in sit commodo aliquip. Inermis neglegentur vis an, ea mei habeo animal verterem. Cum vivendo intellegam disputando id, usu id dicta harum convenire. Cibo corpora ut pri, sed legere probatus aliquyam no, vidisse suscipiantur eu mea. Modus etiam concludaturque pro an, ut latine quaeque per. Harum ignota mnesarchum pri ad, duo et diam oblique epicurei, pri ne vivendo omnesque epicurei.</p> 
    </div> 
    <br class="clear"/>
  </div>

</div>

</body>
</html>
  • 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-13T23:00:12+00:00Added an answer on May 13, 2026 at 11:00 pm

    This isn’t terribly flexible – you have to set the padding for each DIV depending on the image, but its very clean markup wise:

    <style>
    div.one {
       padding-left: 210px;
       overflow: auto;
    }
    div.one img {
        float: left;
        margin-left: -210px;
    }
    </style>
    
    
    <div class="one">
    <img src="http://www.pixeloution.com/breakdown.png" width="200" />
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum blandit orci sed turpis aliquet ac mattis sem t...
    </div>
    

    See it in action at: http://jsbin.com/iniqu3/2

    Notice if you make your screen very narrow, the text does not wrap around the image, as per your example.

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

Sidebar

Related Questions

Often you need to show a list of database items and certain aggregate numbers
Often times it seems I have a list of items, and I need to
Here at work, we often need to find a string from the list of
I often need to design a dialog in Delphi/C++Builder that allows various properties of
When I am writing code in Python, I often need to remove items from
Very often I need something like that: foreach (Line line in lines) { if
I need to rearrange a list of items so that the selected item goes
Hello friendly guys. On Linux with Bash, I often need to list environment variables(env-var)
I often need to run reduce (also called foldl / foldr, depending on your
I have two scripts that often need to be run with the same parameter:

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.