Bootstrap tooltip showing behind modal window
Asked Answered
S

3

15

I have a modal window which consists this div:

<div class="input-group">
    <div class="input-group-addon" title="Insert here your domain account name" data-toggle="tooltip" data-placement="left" id="Account">
        @Html.Label("Domain account name", new { @class = "control-label" })
    </div>
    <div class="a">
        @Html.TextBoxFor(model => model.Login, new { @class = "form-control" })
        @Html.ValidationMessageFor(model => model.Login)
    </div>
</div>

As you can see, there is a tooltip on the label.

It's initalized with this code:

$('#Account').tooltip({ container: 'body' });

The code is working, but the tooltip is showing behind the modal. I tried setting the z-index of the tooltip like this:

.tooltip {
    z-index: 1151,!important;
}

or

 #Account {
     z-index: 1151,!important;
 }

but none of them worked.

Can you suggest how should I set up CSS to make this tooltip show on top of the modal?

Sigismondo answered 24/3, 2014 at 7:22 Comment(0)
C
12

Try without comma before !important:

.tooltip{
  z-index: 1151 !important;
}
Crossbow answered 24/3, 2014 at 7:30 Comment(0)
N
2

Just do one thing. Check the z-index of your modal popup & set the tooltip z-index +1 of your modal popup z-index.

so it would be like

.tooltip{
  z-index:( z-index of modal popup + 1 );
}
Noncompliance answered 13/2, 2019 at 5:10 Comment(0)
S
0

this worked for me.

.tooltip{
  z-index: 1 !important;
}
Stagehand answered 3/12, 2018 at 5:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.