Jump to content

Display a hover box


Sunamena

Recommended Posts

I don't know how to do this and maybe you guys know how to do this.


I want to have the following:


<p>
Hello, I am an Example.
</p>


When someone hovers over Example, it has a box appearing on top of it (just like <abbr> would, but <abbr> should be used for words like: AFK, LOL, HTML,...). So how do I make that happen and how do i style the box correctly?



This is what I have in mind for the box:

CSS
width:100px;
height:auto;
background-color:rgba(255,255,255,0.8);
border:2px solid rgba(0,0,0,0.8);
border-radius:15px;
padding:5px;

 

 

 

 

 

So how do I make that box appear? (it should appear next to your mouse cursor)



Thanks in advance =D

Link to comment
Share on other sites

Wrap it in a span and give it a title attribute.

<p>
Hello, I am an <span title="An example phrase.">Example</span>.
</p>

The title attribute can be used on any element. The appearance of the tooltip is given by the browser and cannot be modified.

 

If you wanted to change the appearance you would have to make a Javascript program.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...