I have a layout similar to:
I would like for the div
to only exp
You can use inline-block
as @user473598, but beware of older browsers..
/* Your're working with */
display: inline-block;
/* For IE 7 */
zoom: 1;
*display: inline;
/* For Mozilla Firefox < 3.0 */
display:-moz-inline-stack;
Mozilla doesn’t support inline-block at all, but they have -moz-inline-stack
which is about the same
Some cross-browser around inline-block
display attribute:
https://css-tricks.com/snippets/css/cross-browser-inline-block/
You can see some tests with this attribute in: https://robertnyman.com/2010/02/24/css-display-inline-block-why-it-rocks-and-why-it-sucks/