I’m trying to put div elements right next to each other. The problem is, even if there is enough room for the two elements to be on the same line, the new div moves itself to the next line, I need the other div only to go to the next line if there isn’t enough room.
Does anybody know how to do this?
Set the CSS display style to
display:inline-block;.This allows the element to keep it’s block-like functionality, while also allowing it to be displayed inline. It’s a half-way house between the two.
(But note that there are some compatibility issues with older versions of IE)