How to make multiple divs display in one line but still retain width?

The Solution to How to make multiple divs display in one line but still retain width? is


You can use display:inline-block.

This property allows a DOM element to have all the attributes of a block element, but keeping it inline. There's some drawbacks, but most of the time it's good enough. Why it's good and why it may not work for you.

EDIT: The only modern browser that has some problems with it is IE7. See Quirksmode.org

~ Answered on 2012-01-19 02:19:41


Most Viewed Questions: