How to get these two divs side-by-side?

The Solution to How to get these two divs side-by-side? is


Since div's by default are block elements - meaning they will occupy full available width, try using -

display:inline-block;

The div is now rendered inline i.e. does not disrupt flow of elements, but will still be treated as a block element.

I find this technique easier than wrestling with floats.

See this tutorial for more - http://learnlayout.com/inline-block.html. I would recommend even the previous articles that lead up to that one. (No, I did not write it)

~ Answered on 2011-03-22 06:33:19


Most Viewed Questions: