2

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

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

3 Comments

i know i have to remove the property, i'm more curious about why it conflicts with the tooltip
@MaximeARNSTAMM 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.
oh, cool. That's my answer, thanks :) Put your comment in the response body so i can accept it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.