mistily
mistily

Reputation: 63

How to specify width of a tooltip in Bootstrap 2

I have this html code with bootstrap classes:

<div class="input-append">
    <input type="text">
        <span class="add-on">
        <a rel="tooltip" data-original-title="this is the tooltip text but it's too long to display" href="#">
            <i class="icon red icon-remove-sign"></i>
        </a>
    </span>
</div>

And in my script.js file i have $('[rel=tooltip]').tooltip();, which is also a bootstrap feature. The problem is, when the tooltip is displayed only a part of the title is displayed. How can I set the width of a tooltip in bootstrap?

Upvotes: 1

Views: 472

Answers (2)

mistily
mistily

Reputation: 63

I have found the solution.

The input-append class has a whitespace:nowrap attribute. If I remove that, it appears normally.

Upvotes: 0

Dinesh Kanivu
Dinesh Kanivu

Reputation: 2587

Give a Class to <a> Tag say

<a rel="tooltip" class="tool"><i class="icon"></i></a>

.tool{ // stuffs}

OR

Create a <div>inside that give the<a rel="tooltip"> and give seperate class to the <div>

Upvotes: 1

Related Questions