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

  • Home
  • SEARCH
  • 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 6613707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:15:03+00:00 2026-05-25T20:15:03+00:00

I found a cool css tooltip script that works perfectly for my site, but

  • 0

I found a cool css “tooltip” script that works perfectly for my site, but it’s been made to work when someone hovers over an href.

I have very limited CSS skills, especially with positioning. So, this may help me out, depending on how I can explain what I need to do.

Below is the and tag , that currently works when you hover your mouse.

<style type="text/css">
    .tooltip {
        border-bottom: 1px dotted #000000; color: #000000; outline: none;
        cursor: help; text-decoration: none;
        position: relative;
    }
    .tooltip span {
        margin-left: -999em;
        position: absolute;
    }
    .tooltip:hover 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);
        font-family: Calibri, Tahoma, Geneva, sans-serif;
        position: absolute; left: 1em; top: 2em; z-index: 99;
        margin-left: 0; width: 250px;
    }
    .tooltip:hover img {
        border: 0; margin: -10px 0 0 -55px;
        float: left; position: absolute;
    }
    .tooltip:hover em {
        font-family: Candara, Tahoma, Geneva, sans-serif; font-size: 1.2em; font-weight: bold;
        display: block; padding: 0.2em 0 0.6em 0;
    }
    .custom { padding: 0.5em 0.8em 0.8em 2em; }
    * html a:hover { background: transparent; }
    .warning { background: #FFFFAA; border: 1px solid #FFAD33; }
</style>


<table style="width:100%;">
  <tr>
    <td>
      <a class="tooltip" href="#">Warning<span class="custom warning">
      <img src="/images/tooltip/warning.png" alt="Warning" height="48" width="48" />
      <em>Warning</em>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua!</span>
     </a>
    </td>
  </tr>
</table>

You’ll see I have an image too. It’s a simple yellow exclamation hazard sign. But it settles nicely to the left of the tooltip box.

I’m now trying to use this same tooltip (rounded edges and all), without the hover.
In other words, I liked it so much I want to place it on my web page, maybe in the header, on the right side, and have it as a static thing.

After playing with the styles, I have basically come to the conclusion I need help with positioning.

You’ll see .tooltip span { margin-left: -999em; position: absolute; }
This has been a primary problem with me. I figured if I took out the margin-left it would simply show the tooltip, without needing the :hover to display. Alas, it eludes me!

How can I simply “delete” the , and just show the tooltip, as is, without needing the hover?

  • 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-05-25T20:15:03+00:00Added an answer on May 25, 2026 at 8:15 pm

    Edit
    I felt like being nice, and i’m bored. So here it is again with fixed top right positioning. I also changed the class names (tooltip just seems like it will probably be used for something else)

    Fixed Positioning

    Ok, so I have stripped out everything you don’t need (from a glance)

    See Here

    HTML

    <div class="tooltip" href="#"><span class="custom warning">
        <img src="/images/tooltip/warning.png" alt="Warning" height="48" width="48" />
        <em>Warning</em>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua!</span>
    </div>
    

    CSS

    .tooltip {
        cursor: help;
        position: relative;
    }
    .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);
        font-family: Calibri, Tahoma, Geneva, sans-serif;
        position: absolute; left: 1em; top: 2em; z-index: 99;
        margin-left: 0; width: 250px;
    }
    .tooltip img {
        border: 0; margin: -10px 0 0 -55px;
        float: left; position: absolute;
    }
    .tooltip em {
        font-family: Candara, Tahoma, Geneva, sans-serif; font-size: 1.2em; font-weight: bold;
        display: block; padding: 0.2em 0 0.6em 0;
    }
    .custom { padding: 0.5em 0.8em 0.8em 2em; }
    .warning { background: #FFFFAA; border: 1px solid #FFAD33; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found cool article on Creating cross platform GUI's with IronRuby where someone re-created
I'm working on some kind of gallery. Found cool ready solution but i want
At wtfjs , I found that the following is legal javascript. ,,, == Array((null,'cool',false,NaN,4));
In google map's reference I found the MVCObject,it provide some cool function. But I
Found out about this cool jQuery countdown which is initialized as such: <script type="text/javascript">
I'm currently creating a CMS system and found that the following doesn't work. I
I found this link. Very cool. That shows how you can store appsettings in
I found this cool js gettext library -> http://code.google.com/p/gettext-js/ but I don't understand how
I recently found a cool little project that I would like to download the
I'm very new for ASP.NET MVC. I found that this is very cool thing

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.