Maxime ARNSTAMM
Maxime ARNSTAMM

Reputation: 5314

Css tooltip hidden by overflow?

I want to put a css tooltip on links inside a table.

Here's my markup :

<a class="tooltip" href="/link">
    My link text
    <span class="tooltip-span">
        my tooltip text
    </span>
</a>

Here's my css :

.tooltip {
    cursor: help;
    text-decoration: none;
    position: relative;
}

.tooltip .tooltip-span {
    margin-left: -999em;
    position: absolute;
}

.tooltip:hover .tooltip-span {
    border-radius: 5px 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;

    box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.1);
    -webkit-box-shadow: 5px 5px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 5px 5px rgba(0, 0, 0, 0.1);

    position: absolute;
    left: 1em;
    top: 2em;
    z-index: 99;

    margin-left: 0;
    width: 250px;
    padding: 0.8em 1em;

    background: #F9F9F9;
    border: 1px solid #D9D9D9;
    color: black;
}

But, in some of my tables, the <td> tag has the css property overflow: hidden; causing the tooltip to stay hidden.

I really don't know how the overflow property could break my tooltip like that.. Can someone explain to me the relation ?

Thanks

Upvotes: 2

Views: 3271

Answers (1)

Andres I Perez
Andres I Perez

Reputation: 75379

Remove the overflow:hidden property? I can't think of any reason why you would use one inside a td unless you were trying to suppress the overflow from a div inside of it.


If the tooltip resides inside of the <td> then its susceptible to overflow, and thusly it is hidden as you instructed it to be using overflow:hidden.

Upvotes: 2

Related Questions