Jump to content

How can I have two columns (each row has text and image), with one DIV?


ghurty

Recommended Posts

Here is an example:

 

HTML:

<div id="columns">
  <p>some text</p>
  <span><img src="img.jpg" alt="image" /></span>
  <p>some more text</p><span>
  <img src="another/img.jpg" alt="another image" /></span>
</div>

 

CSS:

#columns
{
  width: 1000px;
  margin: 0 auto;
  overflow:auto;
}

#columns p
{
  width:50%;
  float:left;
  clear:both;
}

#columns span
{
  width:50%;
  float:right;
}

 

You'll have to adjust the numbers depending on the size of your image and stuff. But this is a basic outline.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.