Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9198687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:20:42+00:00 2026-06-17T22:20:42+00:00

I have tooltips whose content can range from very long to very short. I

  • 0

I have tooltips whose content can range from very long to very short. I don’t want to have 3 words’ worth of content and have a huge tooltip, but I also don’t want 20 words and have it all scrunched up on multiple lines. With this current setup, it stays stuck at the minimum width regardless.

The CSS:

.tooltip {
  outline: none; position: relative;
  min-width: 75px; max-width: 255px;
}

.tooltip .tool-content {
  opacity: 0; visibility: hidden;
  position: absolute;
}

.tooltip:hover .tool-content {
  background: #999; border: 1px solid #555; color: #000000;

  /* general styling */
  position: absolute; left: 1.3em; top: 2.6em; z-index: 99;
  visibility: visible; opacity: 1;
}

The HTML:

<div class='tooltip'>
(content to hover)
    <span class='tool-content'>
        (tooltip content)
    </span>
</div>

What troubles me is that I can take off position: relative and it works as intended! Yet I can find no work around, and relative positioning is key (or appears to be?) to having CSS hovers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T22:20:43+00:00Added an answer on June 17, 2026 at 10:20 pm
    .tooltip {
      outline: none;
      position: relative;
      width: 75px;
      min-width: 75px;
      max-width: 255px;
    }
    
    .tooltip .tool-content {
      margin:0;
      padding:0;
      opacity: 0;
      visibility: hidden;
      position: absolute;
      width:100%;
      height:100%;
    }
    

    You can remove span and replace it with a block level element (like div with style display:block)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page with many tooltips. I want to show/hide every one seperatly
In my Silverlight 4 application I have some long tooltips. By default these tooltips
I have a process (whose output I can customize) running in a comint shell
I have a jsp webpage which is dynamically generated. I want to have tooltips
I want to style(css) some bootstrap-tooltip.js tooltips, without affecting all the tooltips. I have
I have a TreeView whose contents (nested TreeViewItems) are generated from a dataset via
I'm trying to have 'help' tooltips which appear when you click on labels of
I have an application that has a list of buttons and has customized tooltips.
I am using Qtip jquery plugin for my tooltips and because I have many
I have got a JComponent. The paintComponent method is overridden. I mentioned that tooltips

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.