tags:

views:

452

answers:

3

I've got two spans in a div. I want to align them next to each other. I'm doing this by floating them both left and right. The problem is that these spans have variable heights (they slide down when you click for 'more options'). So when their heights are changed during runtime (by sliding down), they won't push down the elements under them. If there's a way to align them without floating them, that would work.

+2  A: 

Maybe an element with "clear:both" after those spans will solve your problem?

Pomyk
You mean float one span either left or right with clear:both, leave the other as is?
gAMBOOKa
Got it... this works perfectly!
gAMBOOKa
A: 

At the risk of getting massive downvotes, use a <table>?

Tyrone Slothrop
I'll be first to downvote
gAMBOOKa
+1  A: 

Put overflow:auto or overflow:hidden on your div. This will force the div to size to the floating contents inside.

Joel Potter