I'm trying to create a custom overlay that basically just contains a HTML element (a div in this case) with text in it. The overlay gets rendered ok but the text is multiline, where I would like it to be one line. Looking into the DOM with Firebug I can see that the computed width for the div parent is 44px, which is why it can't expand and render the text in one line. Is there any way I can correct this without knowing in advance what the required width for the div is?
Asked
Active
Viewed 239 times
0
-
see that one: http://stackoverflow.com/questions/118241/calculate-text-width-with-javascript – slawekwin Dec 02 '11 at 09:18
1 Answers
1
you can set white-space property of your div to nowrap
div.x { white-space:nowrap; }

bsrykt
- 1,275
- 9
- 9