I've run across this simple layout problem many times and never worked out a good solution. I have a

and I want to display some text immediately to its right and/or its left, ie.

Left text <div>Stuff inside div - one line</div>Right text

The div must be a div and it must be a block element - I have no control over that. Visually, though, it's one line and I want to display the text on the same "line". What's the best way to do this?

1 answer

This was chosen as the best answer

Set the div to display:inline-block; and use vertical-align: bottom; but beware older versions of IE.

Some commentary here:


Answered about 9 years ago by Tony Crockford
  • Excellent, thank you! I never knew about "inline-block". Evgeny about 9 years ago