You only need to float one element in this case. The class1 div can be floated left, given a width, and that will allow the class2 element to slide up beside the class1.
Remember, a div will take up ALL the space available left to right, if you don't specify a width less than it's container.
Teedoff is correct, I would also just specify a width, just so that you know what you are working with, well I guess it depends how you want the site to look and function.