tags:

views:

41

answers:

2

Hi, here's my case. I want two divs to be side by side. The left one holds the text and the right one holds image. The right one needs to be fixed width. I did follow the solution from one previous question (the difference was that in that case the left div was fixed width) and it's not working for me.

Here's the HTML (the two divs are bold written - vsebina in icon):

<div class="background"> 
  <div class="content"> 
    <div class="leftCol"> 
      <div id="Storitve">
        <div class="contentBox">
          <div class="contentBoxLeft">
            <div class="title">Vzdrževanje</div>
          </div>
          <div class="contentBoxRight">
            <div class="vsebina"> 
            </div>
            <div class="icon">
            </div>
          </div>
        </div 
      </div> 
    </div>
  <div class="rightCol"> 
  </div> 
  <div class="clear"> </div> 
</div> 
<div class="clear"> </div> 
</div> 

Here's the CSS:

   .vsebina {background-color:#876392;}
    .icon {background-color:#872472; width:150px; float:right; height:auto;}

THX for any help! Uros

+1  A: 

try

display:inline-block;
float:left;

on left div

Vinay B R
Hi Vinay B R, thx but it's not working
Uros
A: 

Try this:

.vsebina
{
    background-color: #876392;
    float: left;
}
.icon
{
    background-color: #872472;
    width: 150px;
    float: left;
    height: auto;
}
Manish
Hi, ManishTHX for your reply. If I do that, the ICON div is under the VSEBINA div not next to it
Uros
@Uros: Well, that worked for me..I'm not sure if it's the `contentBoxRight` class which is creating problem for you or the cross-browser problem..!! BTW, I checked it in Chrome 6, FF 3.6.10 and IE8.
Manish