Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Tooltip Length automatically related to content length

Hi All,

i have multiple tooltips with different tooltip lengths. In some cases the content is displayed outside the tooltip box because of its length.
Is there any way i can automatically assign the tooltip lentgh in accordance to the content length?
Whenever i have few content, the tooltip length should be little as well as in the opposite case the tooltip length should be sufficiently big to cover all content if there is a lot.

I'm looking for a fast implementation for many tooltips.

Best regards!
asked Oct 31, 2019 by Raphael

1 Answer

0 votes
Does this CSS suit your needs?

<style>
.tool_tip_text {
    width: auto;
    height: auto;
}
</style>


That can be added to a single question to have it apply to all tooltips on that page, or to your survey HTML head tag to have it apply to all tooltips in the survey.
answered Oct 31, 2019 by Zachary Platinum Sawtooth Software, Inc. (134,850 points)
Thanks, Zachary!
It worked. Is it possible to restrict the width to a maximum value but still using auto height?
The goal would be to have a tooltip that is always the same in width but individually long in height depending on the content length.

Best regards!
You could add a "max-width" attribute to that CSS code to set a maximum number of pixels for any tooltip.

If you have images in your tooltips, giving them a max-width of 100% may also be prudent.

<style>
.tool_tip_text {
    max-width: 200px;
    width: auto;
    height: auto;
}

.tool_tip_text img {
    max-width: 100%;
}
</style>
...