I created a tooltip using Twitter Bootstrap.
The tooltip is displaying with three lines. However, I would like to display the tooltip with only one line.
How do I change the width of the tooltip? Is this specific to Twitter Bootstrap or to tooltips themselves?
Another solution; create a new class (e.g. tooltip-wide) in CSS:
Use this class on elements where you want wide tooltips:
Bootstrap tooltip generates markup below the element containing the tooltip, so the HTML actually looks something like this after the markup is generated:
The CSS uses this to access the adjacent element (+) to .tooltip-wide, and from there navigates to .tooltip-inner, before applying the max-width attribute. This will only affect elements using the .tooltip-wide class, all other tooltips will remain unaltered.
BS3:
Please refer the below post. cmcculloh's answer worked for me. https://stackoverflow.com/posts/31683500/edit
As hinted at in the documentation, the easiest way to ensure that your tooltip does not wrap at all is to use
With this, you don't have to worry about dimension values or anything like that. Main problem being if you have a super long line of text it will just go off of the screen (as you can see in the JSBin Example).
Try this code,
Mine where all variable lengths and a set max width would not work for me so setting my css to 100% worked like a charm.
after some experimenting, this worked best for me: