Html – How to float 1st div to left and the 2nd to the right

csshtmlupdatepanel

I have a DIV with two update panels inside of them. The update panels render as divs but asp.net does not let me assign a class to a div. I can do this using jQuery by assigning css to the first child, then assigning different css to the 2nd or last child. Can I do this purely with css?

Something similar to this:

.outerdiv div
{
   width:45%;
}

/*float:left */
.outerdiv div(0)
{
   float:left;
}

/*float:right */
.outerdiv div(1)
{
   float:right;
}

Best Answer

Or you can wrap the Update Panel DIVs with another DIV...

<div class="outerdiv">
  <div class="outerdivleft">
    ... Update Panel Left ...
  </div>
  <div class="outerdivright">
    ... Update Panel Right ...
  </div>
</div>