tags:

views:

161

answers:

4

Hi, I have a layout like this:

Header div
divLeft divRight
Footer div

divLeft is a bunch of text and divRight is a div with some stuff in it. divLeft is a lot longer and I would like the text to wrap under divright. right now it's just making two columns and there's a lot of white space under divRight. Help? Thanks!

+3  A: 

Put divRight inside divLeft and float it.

Try this:

CSS

<style type="text/css">
#primary, #header, #footer {
 float: left;
 width: 100%;
}

#secondary {
   float: right;
      width: 200px; /* or whatever width you want */
}
</style>

HTML

<div id="header">
</div>
<div id="primary">
   <div id="secondary">
      <p>Put your content here that goes on the right</p>
   </div>
   <p>Put your content here<br /> 
      that goes on the left<br /> 
      and should wrap under the right-hand column</p>
</div>
<div id="footer">
</div>
Donut
ah yes i wasnt putting it inside...stupid me thanks!
A: 

You can float divRight right. That should allow the left div to wrap under the right text.

Edit: You will also need divRight inside of divLeft as described by Donut.

statikfx
A: 

I have a very nice solution; take a look at the source of the example here.

Rin
A: 

Place divRight inside divLeft and give it these properties:

.divRight {
    display: inline-block;
    display: -moz-inline-box;
    -moz-box-orient: vertical;
    vertical-align: top;
    zoom: 1;
    *display: inline;
}
Nimbuz