How do I prevent DIV tag starting a new line?
The div
tag is a block element, causing that behavior.
You should use a span
element instead, which is inline.
If you really want to use div
, add style="display: inline"
. (You can also put that in a CSS rule)
I am not an expert but try white-space:nowrap;
The white-space property is supported in all major browsers.
Note: The value "inherit"
is not supported in IE7 and earlier. IE8 requires a !DOCTYPE
. IE9 supports "inherit"
.