Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

194
Views
Tooltip- how can I make it taller not wider?

I have a question regarding the tooltip I have used from w3schools.com

I have it entirely in CSS but have the problem, that when it shows at the edge of a side, it cuts the tooltip off.

My ideal thing would be, that it detects when the side is stopping and it makes the given div taller, not wider.

.tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    font-size: 20px;
    color: darkslategrey;
}

    .tooltip .tooltiptext {
        visibility: hidden;
        width: 260px;
        background-color: darkslategrey;
        color: #fff;
        text-align: center;
        border-radius: 6px;
        padding: 16px 0;
        position: absolute;
        z-index: 1;
        bottom: 125%;
        left: 50%;
        margin-left: -80px;
       
        position: absolute;
        z-index: 1;
        font-size: 16px;
        
    }

    .tooltip:hover .tooltiptext {
        visibility: visible;
       
    }
     .tooltiptext {

         text-shadow:none;
     }

.tooltip .tooltiptext:after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: darkslategrey transparent transparent transparent;
    
}
<span class="tooltip">The highlighted word<span class="tooltiptext">The text in my tooltip</span></span>

Thank you for any kind of help, where I could begin.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!