Maximum Width of jQuery UI Tooltip widget

sl3dg3 picture sl3dg3 · Oct 18, 2012 · Viewed 50.8k times · Source

I use jQuery UI's new Tooltip and having trouble with figuring out how to set a maximum width of the tooltip. I guess it should be done with position, but how?

Answer

sl3dg3 picture sl3dg3 · Oct 18, 2012

Based on Senni's reply, I added following to a separate CSS-file:

div.ui-tooltip {
    max-width: 400px;
}

A sidenote: Make sure your separate CSS follows after the ui-css, otherwise there will be no effect. Otherwise you also could use the !important - marker.