How to not wrap contents of a div?

JamesBrownIsDead picture JamesBrownIsDead · Nov 9, 2009 · Viewed 204.9k times · Source

I've got a fixed-width div with two buttons in it. If the labels of the buttons are too long, they wrap – one button stays on the first line, and the next button follows underneath it instead of adjacent to it.

How can I force the div to expand so that both buttons are on one line?

Answer

Marek Karbarz picture Marek Karbarz · Nov 9, 2009

Try white-space: nowrap;

Documentation: https://developer.mozilla.org/docs/Web/CSS/white-space